View Full Version : simulating stars at infinity
11-14-2000, 11:28 PM
I want to simulate stars that look far off. Whenever I draw the stars (the procedure called by glutDisplayFunc() ), I want to use gluPerspective and set the far clipping plane to some huge number, draw the stars and then return the clipping planes to their previous values to draw other things close up. However when I do this, I end up seeing nothing. Any suggestions on how to go about doing this? Some example code would help greatly.
This might work (pseudocode)
gluLookAt(origin, rot, up...)
render all of your stars on a 1 unit radius sphere (distance doesn't matter IIRC)
gluLookAt(pos, rot, up)
render the rest of your screen
This is like drawing a skybox, you rotate the infinity stuff, but do not translate it, and you draw it with depth testing turned off.
Then redo your modelview with both the position and rotation and draw the rest of the universe.
[This message has been edited by joat (edited 11-15-2000).]
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.