PDA

View Full Version : rolling two balls + reflection



04-09-2001, 07:58 PM
hi,
I got a problem when I trying to add another ball which also suppose have reflection in the table in the NeHe's tutorial lession 31 for reflection. I made the first ball rotate along X, Z axises, it is all fine.
but when i add the second ball. following the first one, it just always rotate around the first ball like base on the new coordinate X,Z, Y axises.
then I have no idea how to handle the second ball seperately without effect by the first one.
any one can give me some hints?
thank you very much

--- lf

RDMustang
04-10-2001, 03:50 AM
You just need to push and pop matricies before and after you do your stuff for each ball. like this:
pushmatrix
do stuff here for first ball
popmatrix
pushmatrix
do stuff here for second ball
popmatrix

done http://www.opengl.org/discussion_boards/ubb/smile.gif

04-10-2001, 06:05 AM
Hahaaa.....!

It works!.... http://www.opengl.org/discussion_boards/ubb/smile.gif

thanks a lot!

---lf