#### Archived

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

# 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.

## 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 on other sites
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 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

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5

• 9
• 27
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633395
• Total Posts
3011651
• ### Who's Online (See full list)

There are no registered users currently online

×