Original Post
Hi, How can I set up my view space so that the screen is 100 units wide?
Quote:You'd have to either scale it when you render it, or scale it just after loading (change the position of all the vertices), yes.
Original post by KalleKlovn
I think I understand. Thank you. The model I'm loading is about 50x50x50 cm in the 3d modeling program, but when I load it into direct3d it's about 10 units wide. 1 unit is then 5 cm. Can I change this. I want my model to be 1 unit wide. I know I can scale it when rendering it, but is this the only way?
struct Vertex{ float x, y z;};BYTE* pVertex;DWORD dwVerts = pMesh->GetNumVertices();DWORD dwStride = D3DXGetFVFVertexSize(pMesh->GetFVF());pMesh->LockVertexBuffer(D3DLOCK_READONLY,&pVertex);for(DWORD i=0; i<dwVerts; ++i){ Vertex* pVert = (Vertex*)pVertex; pVert->x /= 10.0f; pVert->y /= 10.0f; pVert->z /= 10.0f; pVertex += dwStride;}pMesh->UnlockVertexBuffer();This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more