Display static objects
Hello,
I tried to implement some kind of static objects in my game, but the way I tried gave no success. My intention is to create an object like the moon in real life, always staying at the same position, as you are moving around.
I think this should be almost the same as the skybox, but I did not get this to work. Do you have any hints on how to handle the world translations?
Thanks in advance,
Marco
Yea, what you need is a skybox.
It's the simplest thing to do relative the effect it creates, that is why even the original doom uses it.
all you have to do is to draw a cube(10x10x10 is a good size) with it's center around the camera position, the correct texture on each face and z-writing/z-testing turned off.
If you only need the moon, try drawing a plane(with the moon texture) that is facing the camera position and allso keeps itself at a constant distance from the camera.
Simple. :)
It's the simplest thing to do relative the effect it creates, that is why even the original doom uses it.
all you have to do is to draw a cube(10x10x10 is a good size) with it's center around the camera position, the correct texture on each face and z-writing/z-testing turned off.
If you only need the moon, try drawing a plane(with the moon texture) that is facing the camera position and allso keeps itself at a constant distance from the camera.
Simple. :)
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
you may use multitexture to skybox. or making 2-3 skyboxes and make them trasparent/overlay. (like layers)
you dont need to handle world transformations..
you dont need to handle world transformations..
+-+-+-+-+-STR
If you need to use 3D objects, then rotate the camera to wherever it needs to be looking, draw all the static objects normally (using calls to glTranslate and glRotatef - don't forget to Push and Pop). When you're finished, Translate the camera to it's position (the angle has already been set) and draw the rest of the game objects.
Voila. Static objects that rotate with the camera but are always at a fixed distance away.
Voila. Static objects that rotate with the camera but are always at a fixed distance away.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement