Jump to content
  • Advertisement

Archived

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

DevLiquidKnight

Cut a sphere in half using DirectX9 or no?

This topic is 5424 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

I was wondering which way would work "better" for a skydome type of thing I was thinking maybe just create a large sphere around the camera applying a cloud like texture and rotating it. However, is it better to do this with a whole sphere or just a like cut in half sphere? I think it would be easier to just call the directx function to create a mesh for a skydome as a sphere and apply a sky-like texture to it and rotate it. I am kinda confused on how I can seperate the sphere rotation from the rest of the scene though? Does anyone know what im talking about, or like how to seperate the sphere rotating from the rest of the world matrix? (not to good at direct3d yet )

Share this post


Link to post
Share on other sites
Advertisement
You could just make a hemisphere by specifying it in spherical coordinates. Look up spherical coordinates. Conceptually its a lot like making a mesh out of a hieght field except you convert from spherical to rectangular.

The way to handle rotations for individual objects is to set the world matrix for each object before redering it. Each model should be set in local space, with its pivot point at 0,0,0; you do not typically model everything in world coordinates. For instance if you have 2 trees that share the same model, but one is at (1,0,0) and the other is at (-1,0,0), you create the translation matrix:

[ 1 0 0 0 ]
[ 0 1 0 0 ]
[ 0 0 1 0 ]
[ 1 0 0 0 ]

render the 1st tree, change the matrix to:

[ 1 0 0 0 ]
[ 0 1 0 0 ]
[ 0 0 1 0 ]
[-1 0 0 0 ]

and render it again to draw the second tree. You do not load and render 2 tree models who''s only difference is -2 in the x position.

Share this post


Link to post
Share on other sites
I kind of understand. I like to always start with the easiest still thing, then make it move. I would create the sphere, or cubes are used too, then rotate the entire sphere around the world. You would set the world transformation for the other objects in the world, before drawing them, just as you would for the sphere. So you rotate the sphere, set the transform, draw it, reset the world transform to draw your next object (a playfield), and set the world transform for all other objects as needed.

Chris

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!