Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Reading values from the internal camera matrix

Author
Message
Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 10th Dec 2005 15:43
Hi there,

Is there any way to access the internals of the camera matrix in Dark SDK? I'm specifically after the 'LookAt' vector, and whilst it's possible to calculate it by rotating a vector about the camera's 3 euler angles (obtained from dbCameraAngleX() etc.) it's far more efficient to pull the pre-calculated numbers straight from the camera matrix.

I can get hold of this information from an object by using the internal 'GetObject' function which I discovered while looking through the ODE dll code in the Extras pack. From the returned sObject pointer I can get at the 'object->position.vecLook' D3DXVECTOR. I just wondered if there was a way to get this information for the cameras?

I also had a go at getting hold of the D3DDevice handle and calling 'Device->GetTransform(D3DTS_WORLD)', however this seems to crash internally in DirectX, possibly because the device is pure and doesn't support the 'get' functions.

Thanks
Kaiyodo.
Miguel Melo
18
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 10th Dec 2005 16:11
Quote: "
From the returned sObject pointer I can get at the 'object->position.vecLook' D3DXVECTOR.
"


Hey, cool! Thanks for pointing this one out: will fit this in my code to speed things up a bit and get rid of all that trig.
Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 15th Dec 2005 13:43
If anyone else is interested, the commands for acessing the camera's look at vector are ..

float dbCameraLookX(int camera)
float dbCameraLookY(int camera)
float dbCameraLookZ(int camera)

These commands aren't in the documentation, but they are in the header files.

Kaiyodo.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 15th Dec 2005 16:17
Very interesting! Now I understand what you were after.
For finding camera look-at vector I use:


But it is faster to use the functions that you said, although I don't get exactly the same numbers than with the pick screen method

I wish that TGC complete the documentation, but I see that now more far away than ever, does anybody know if Santa is coming to town?
Miguel Melo
18
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 15th Dec 2005 17:43
Quote: "I wish that TGC complete the documentation, but I see that now more far away than ever, does anybody know if Santa is coming to town?"


I fear that Santa seems to have moved on from distributing presents and is probably spending his time doing some newfangled thing that will be of no interest to us waiting children...

Login to post a reply

Server time is: 2024-05-07 00:35:57
Your offset time is: 2024-05-07 00:35:57