#### Archived

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

# Define size of world space...

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

## Recommended Posts

Hi, How do you define the size of world space for your game ? If I have an object that as an xpos=20,ypos=30,zpos=100 and another object say of xpos=700, ypos=450, zpos=10 how do you know which one is in view space - I know this is down to the view transformation matrix, but again I still am trying to get my head around how you define the size of your world ? If I was to place a camera as such : D3DXMATRIX matView; D3DXMatrixLookAtLH( &matView, &D3DXVECTOR3( 0.0f, 10.0f,-5.0f ), &D3DXVECTOR3( 0.0f, 0.0f, 0.0f ), &D3DXVECTOR3( 0.0f, 1.0f, 0.0f ) ); which object would I see, if any ? I guess it''s the first one and if so, how would I then move the camera in such a way as to see the second object ? I guess I''m asking two questions now! 1. How do you define size of world space 2. How do you move the camera around to walk through the world Hope someone can help me out with this, all the example code I see is code that sets the world matrix to an identity matrix. Thanks, sTeVe

##### Share on other sites
The world space is pretty much what you define it as. You''ll probably only want to view a small portion of it at a time so that you don''t bog down your video card. You can change the parameters of how much of the world is visible (depth-wise) with something like:
D3DXMATRIX matProj;
D3DXMatrixPerspectiveFovLH(&matProj,D3DX_PI/4,1.0f,1.0f, 100.0f);

To move the camera around the world, you change the coordinates of the following:
D3DXMATRIX matView;
D3DXMatrixLookAtLH(&matView,&D3DXVECTOR3(0.0f,10.0f,-5.0f),
&D3DXVECTOR3(0.0f, 0.0f, 0.0f),
&D3DXVECTOR3(0.0f, 1.0f, 0.0f));

1. 1
2. 2
3. 3
Rutin
22
4. 4
JoeJ
16
5. 5

• 14
• 29
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631774
• Total Posts
3002287
×