Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


matrix stacks

This topic is 6929 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am moving from retained mode to immediate mode and need some guidance with matrix stacks Currently in Retained mode I create a scene heirarchy as follows: CreateSceneHeirarchy.... Scene (Root) * *--- Sun (Child of Scene) * *--- EarthOrbit (Child of Scene) .........* .........*--- Earth (Child of EarthOrbit) .........* .........*--- MoonOrbit (Child of EarthOrbit) .................* .................*--- Moon (Child of MoonOrbit) Note the Orbit frames are only used as containers so that I can rotate the planets on their own axis whilst they (actually the orbit and therefore the planet) rotates around the sun I then set up various positions and rotations using the following: BuildScene... Sun->SetPosition(Scene,0,0,0) // Set position relative to scene Sun->SetRotation(Scene,0,-1,0,rotamt1) // Set Sun rotating on own Y axis EarthOrbit->SetPosition(Sun,0,0,0) // Set position relative to scene EarthOrbit->SetRotation(Sun,0,1,0,rotamt2) // Set EarthOrbit rotating around sun Earth->SetPosition(EarthOrbit,8,0,18) // Set pos of Earth relative to EarthOrbit Earth->SetRotation(Scene,0,-1,0,rotamt3) // Set earth rotating on own Y axis MoonOrbit->SetPosition(Earth,0,0,0) // Set position relative to Earth MoonOrbit->SetRotation(Earth,0,1,0,rotamt4) // Set moonorbit rotating around earth Moon->SetPosition(MoonOrbit,3,0,0) // Set pos of moon relative to moonorbit Moon->SetRotation(Scene,0,1,0,rotamt5) // Set moon rotating on own Y axis How do I use a matrix stack to do the same sort of thing in Immediate Mode? Edited by - gumball on 5/6/00 2:14:22 AM Edited by - gumball on 5/6/00 2:15:55 AM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!