Sphere

Started by
23 comments, last by SystemFiles 14 years, 1 month ago
the renderfunc from the mod is called between Begin and EndScene.

I have added an output for my position and the camera (pDevice->GetTransform(D3DTS_VIEW,&camera);)
The camera is always the normalized matrix:
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

I have testet the other transformationtypes too (D3DTS_PROJECTION, ...). They all are normalizes matrices. I think the game uses an other method to set the camera. Can I use SetTransform with my current viewangles I can read from the game?

greetz
Advertisement
It sounds like you don't have a view or projection matrix set up. Do you ever call SetTransform(D3DTS_VIEW, ...) or SetTransform(D3DTS_PROJECTION, ...)? If not, you almost certainly need to, passing in a matrix from D3DXMatrixLookAtLH and D3DXMatrixPerspectiveFovLH respectively.
I have added this to the renderfunc:

D3DXMATRIX mProjection;D3DXMatrixPerspectiveFovLH(&mProjection,D3DXToRadian(45.0f),1024.0f/768.0f,1.0f,100.0f);pDevice->SetTransform(D3DTS_PROJECTION,&mProjection);D3DXMATRIX matView;D3DXMatrixLookAtLH( &matView, &D3DXVECTOR3( 0.0f, 2.0f, -25.0f ), // Camera position                                  &D3DXVECTOR3( 0.0f, 0.0f, 0.0f ),   // Look-at point                                  &D3DXVECTOR3( 0.0f, 1.0f, 0.0f ) ); // Up vectorpDevice->SetTransform( D3DTS_VIEW, &matView );

but this changes nothing. This doesn't change my view.

Edit: I have logged the D3DTS_WORLD matrix from every DrawIndexedPrimitve call where the game draws models and stuff. It's always the empty martrix:
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
Is there an other way to tell DIP where to draw the current model? Because if they don't use SetTransform they must do it an other way?!

greetz
Quote:This doesn't change my view.

Why do you say that?

With the view setup as you have it, you're looking at the origin of the world. Can you see your sphere is you draw it at the origin (0,0,0)?

Make sure you have something that does the following:

- Setup your projection and view matrices with the camera at z=-25 and looking at the origin.
- Draw your object at the origin.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

I say this because it has no effect. I don't see the sphere.

greetz KN4CK3R
Would you mind telling us what game you are trying to mod / game engine you use ?
the game uses the Quake3 Engine

greetz
I could be mistaken but I thought iDTech3 (Quake 3's engine) was OpenGL exclusive.
no, there are lots of games that use DX

greetz
Yep it must be possible to use DirectX. But the game is ( I Think ) to fast to use SetTransform. I think you are talking about COD4 because of making mods isnt possible in CODMW2? This will only work with shader driven games.

This topic is closed to new replies.

Advertisement