Easy way to exclude an object from rendering

View previous topic View next topic Go down

Easy way to exclude an object from rendering

Post  billykater on 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

View user profile

Back to top Go down

Re: Easy way to exclude an object from rendering

Post  meteors on 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
avatar
meteors

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

View user profile

Back to top Go down

Re: Easy way to exclude an object from rendering

Post  billykater on 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

View user profile

Back to top Go down

Re: Easy way to exclude an object from rendering

Post  meteors on 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
avatar
meteors

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

View user profile

Back to top Go down

Re: Easy way to exclude an object from rendering

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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