FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Easy way to exclude an object from rendering

2 posters

Go down

Easy way to exclude an object from rendering Empty Easy way to exclude an object from rendering

Post  billykater Wed Feb 18, 2009 4:46 am

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?

billykater

Posts : 4
Join date : 2009-02-18

Back to top Go down

Easy way to exclude an object from rendering Empty Re: Easy way to exclude an object from rendering

Post  meteors Wed Feb 18, 2009 6:53 am

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
meteors
meteors

Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

Back to top Go down

Easy way to exclude an object from rendering Empty Re: Easy way to exclude an object from rendering

Post  billykater Wed Feb 18, 2009 7:15 am

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.

billykater

Posts : 4
Join date : 2009-02-18

Back to top Go down

Easy way to exclude an object from rendering Empty Re: Easy way to exclude an object from rendering

Post  meteors Wed Feb 18, 2009 9:09 am

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
meteors
meteors

Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

Back to top Go down

Easy way to exclude an object from rendering Empty Re: Easy way to exclude an object from rendering

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum