how does jpct draw many transparency objects ?

Started by carl, November 20, 2012, 02:22:42 AM

Previous topic - Next topic

carl

 I make a Clock with 3DMax  composed of some other child Objects ,something like minute hand, second hand and so on , and I need an animation that let the Clock disappear gradually by decrease of its transparency.

then if I rotate the Clock while it is  in the process of disappearance , the total rotation degree is no more than 90. the  Clock will be blinking. sometimes minute hand is in front of second hand ,and sometimes second hand is in front of minute hand.  Why is it blinking ,  does the zbuffer still  work with transparency objects ?  or the zBuffer precision is not enough?

how does JPCT draw with many Objects some of which are transparency and some are not ? does we need to  sort these objects with  z coordinate ?

Thanks

EgonOlsen

They are sorted by their average depth and drawn in that order (painter's algorithm). The z-Buffer is used to read from, but not to write into because it doesn't work well with the alpha channel (i.e. it has no idea if it should actually write the depth or not based on alpha).
If your hands are always in front of the clock, you can use setSortOffset with some negative value to force them to be rendered in front.