Development SIG Toolkit

You are not logged in. Would you like to login or register?

Adding Scene Nodes to a Scene Graph » Loading and adding a model to the scene graph » 9/30/2019 3:18 pm

Admin
Replies: 0

Go to post

First create the SnModel:
SnModel* snm = new SnModel;
bool ok = snm->model()->load("../arm/hand.obj"); // here using relative path

// Another possible way to create snm is:
// GsModel* m = new GsModel();
// bool ok = m->load("../arm/hand.obj");
// SnModel* snm = new SnModel(m);

if (!ok) { gsout<<"Could Not Load!\n"; exit(1); }

// Example of how to get the bounding box of a scene shape:
GsBox b;
snm->get_bounding_box(b); // GsModel also has the same method
gsout << "bbox = " << b << gsnl;

// Adding to a group and then root scene:
SnGroup* g = new SnGroup;
g->add(snm);
...
rootg()->add(g);

Adding Scene Nodes to a Scene Graph » SnGroup separator behavior » 9/25/2019 4:12 pm

Admin
Replies: 0

Go to post

If a group is set to be a "separator", transformations placed inside it will not affect nodes outside it. The default group behavior is to not be a separator. If you want it to behave as a separator you need to call the separator() method, for ex.:
SnGroup *g = new SnGroup;
g->separator ( true );
// add your nodes here as usual, for ex.:
g-> add ( new SnTransform ); // this will now only affect the next shapes inside g
g-> add ( new SnModel );
...

 

Creating Your Own Scene Node » Creating your own scene node » 9/25/2019 4:06 pm

Admin
Replies: 0

Go to post

You can create your own scene node by deriving one of 5 main base nodes, as explained in SnNode comments:
/*! \class SnNode sn_node.h
    \brief base of all scene node classes

    Defines a base class for all scene nodes.
    1. It cannot be directly instantiated by the user, and so there is no
       public constructor available.
    2. Scene nodes start with Sn (scene actions start with Sa, see sa_action.h).
    3. A reference counter is used for automatically deleting unused nodes,
       see ref() and unref() methods in the parent class GsShareable.
    4. Each node is of a given type among 5 possible ones:
    1. a group manages a list of children nodes;
    2. a transform defines a transformation to affect children nodes;
    3. a shape defines a geometric shape to be rendered;
    4. an editor node handles events, a transformation, and children nodes;
    5. a material node gives material info to the next shape for geometry sharing. */

The functionality of your derived node will then be interpreted according to the base class you select. You may also derive from an existing scene node already derived from one of the 5 types listed above. For example, SnPrimitive derives SnModel in order to re-use the rendering calls from SnModel.

If you'd like to create your own shape node you have to derive SnShape, and in addition, provide a class to perform the rendering calls. You can see the needed classes in the self-contained example provided in examples\sigmynode.7z. A more complex shape node is SnModel, which uses class GlrModel for the OpenGL rendering calls.

 

Building a Primitive Object from its Parametric Equation » [Lab-01] Z-Fighting on Torus for different n-values » 9/12/2019 8:34 am

Admin
Replies: 4

Go to post

We can see from the image that there is an overlap. It may only happen for some specific situations depending how you implemented your stop condition. Print the angles you are generating to the console and debug your stop condition, and should then be able to find the problem.

Compilation with Visual Studio » How to select example projects and run them » 9/09/2019 11:25 am

Admin
Replies: 0

Go to post

First open file sigfull.sln with Visual Studio.
On the Solution Explorer panel you will see all the projects that come with the solution.
Select one of the projects under the "programs" entry. For example, to select project "camera test", right click on it and select "Set as StartUp Project". Then to run it you can select menu option Debug->Start Without Debugging (Ctrl+F5), or a similar command.

Note: projects that generate a library (like libsig) do not generate an executable and therefore you will get an error if you try to run them.

If you would like to use an example project as the starting point of your own project, start from the project in examples/sigapp.7z, which is ready to be compiled outside of the SIG main folder. For more information please read the notes in examples/readme.txt.
 

Building a Primitive Object from its Parametric Equation » [Lab-01] Z-Fighting on Torus for different n-values » 9/09/2019 11:12 am

Admin
Replies: 4

Go to post

It looks like you have declared triangles overlapping, for example your parameterization may be declaring the first and last set of triangles twice.

Compilation with Visual Studio » Running Projects with Visual Studio 20XX » 8/28/2019 8:35 pm

Admin
Replies: 1

Go to post

Two additional notes:
- as you have pointed out sigapp.7z needs to be uncompressed and placed in the same folder of the SIG distribution, in order for the SIG libraries to be found, and BTW the same applies to sigmynode.7z;
- you also have to be sure to compile the SIG libraries and your application/example in the same configuration and platform. For example, if you compile SIG in Release version for 32 bits, be sure to compile your example program in the same way.
 

Board footera

 

Powered by Boardhost. Create a Free Forum