Easy way to exclude an object from rendering
2 posters
Easy way to exclude an object from rendering
Is there any easy way to exclude an object from rendering but still have it around for later use.
Basically I want to construct my scene from some of the objects but not necessarily all of them.
Although later on I want to add or remove some of them.
My idea would be adding all the template objects to a different resource and duplicate them as needed.
Is there anything that prevents me from doing this? e.g. Material references or anything that has to be in the same SIO2resource?
Basically I want to construct my scene from some of the objects but not necessarily all of them.
Although later on I want to add or remove some of them.
My idea would be adding all the template objects to a different resource and duplicate them as needed.
Is there anything that prevents me from doing this? e.g. Material references or anything that has to be in the same SIO2resource?
billykater- Posts : 4
Join date : 2009-02-18
Re: Easy way to exclude an object from rendering
Call this before you want to hide your object:
sio2EnableState(&my_object->flags, SIO2_OBJECT_GHOST);
Then to make it visible again:
sio2DisableState(&my_object->flags, SIO2_OBJECT_GHOST);
(where my_object is the name of your SIO2object)
Kind regards,
-joshua
sio2EnableState(&my_object->flags, SIO2_OBJECT_GHOST);
Then to make it visible again:
sio2DisableState(&my_object->flags, SIO2_OBJECT_GHOST);
(where my_object is the name of your SIO2object)
Kind regards,
-joshua
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: Easy way to exclude an object from rendering
Thanks for the answer found it myself some seconds ago while debugging another problem.
Maybe a sio2ObjectMakeVisible as alias for this function would be easier to find.
Maybe a sio2ObjectMakeVisible as alias for this function would be easier to find.
billykater- Posts : 4
Join date : 2009-02-18
Re: Easy way to exclude an object from rendering
I usually write my own functions like this:
void hideTree(){
sio2EnableState(&tree->flags, SIO2_OBJECT_GHOST);
}
...and a commensurate function called showTree().
Makes for more intuitive coding, especially with a state machine like OpenGL.
best,
-joshua
void hideTree(){
sio2EnableState(&tree->flags, SIO2_OBJECT_GHOST);
}
...and a commensurate function called showTree().
Makes for more intuitive coding, especially with a state machine like OpenGL.
best,
-joshua
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Permissions in this forum:
You cannot reply to topics in this forum
|
|