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 / How to Apply a Transformation Matrix to an Object???

Author
Message
The Goat Ass!
21
Years of Service
User Offline
Joined: 30th Sep 2002
Location:
Posted: 4th Jun 2005 11:47
I have been digging through the SDK help and cant find any command that will extract a transformation matrix from an object. Also, I can't seem to find a command to apply a matrix to an object once I'm done mucking with it.

Does anyone know how these are done? There seem to be plenty of other transformation matrix commands...am I just looking in the wrong place?

Any help is greatly appreciated!!!
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 8th Jun 2005 00:44
One method of doing this is as follows -

* to begin with download and install beta 1.1.1

* look in the extras folder of the zip file, copy the headers and source files from here into your project

* add #include "dbodata.h" to your source

* add the following function listing "sObject* dbGetObject ( int iID );", you won't have to do this in the next update as it will be included in the header automatically

* when you have created your object you can then access it directly by doing this "sObject* pObject = dbGetObject ( 1 );"

* you can now access the world matrix transform through "pObject->position.matWorld", this variable is of the type D3DXMATRIX

* when applying your own transform matrix you must modify a property of the object so the engine does not overwrite your custom matrix, this is done using "pObject->position.bCustomWorldMatrix = true;"

By doing this you can control the transform of an object in exactly the way you like.
The Goat Ass!
21
Years of Service
User Offline
Joined: 30th Sep 2002
Location:
Posted: 8th Jun 2005 03:43
Great, Thanks!

I'll give it a try.

One other question...what's the format of the 4x4?

--------
u u u 0
s s s 0
f f f 0
t t t 1
-------

how are the rotation vectors and translate stored?

Thanks again!
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 15th Jun 2005 18:27
QUOTE MikeJ
Quote: "
* add the following function listing "sObject* dbGetObject ( int iID );", you won't have to do this in the next update as it will be included in the header automatically

* when you have created your object you can then access it directly by doing this "sObject* pObject = dbGetObject ( 1 );"

* you can now access the world matrix transform through "pObject->position.matWorld", this variable is of the type D3DXMATRIX

* when applying your own transform matrix you must modify a property of the object so the engine does not overwrite your custom matrix, this is done using "pObject->position.bCustomWorldMatrix = true;"
"


*begging on*
Please, please add a documentation (I would love to see diagrams) for this attributes, please... Please.
*begging off

Personally, I have problems with the documentation as it is atm, and IMO I would like to have a good documentation and then you can start fixing those bugs... but that's just me I assume.

As I've learned from my tutor, write the docmentation first
(well, it was the user guide, but I think it fits in this situation)

Anyway,.. I see that the sObject structure will be in the upcoming patch 1.1.1(final) (or whatever it iwll be called)
(sorry, but NO, I dont download/use beta versions)

--smithy

//Awards: Best DM at NeverwinterConventionIII (NWCon3)
//Sys: Pentium IV 3200E/Prescott;800Mhz FSB;HT;WinXPPro;ATIR9700PRO;1024MB RAM(2x512MB"DualChanneled";VC++7.net;Delphi6;ADSL512;
zao420
20
Years of Service
User Offline
Joined: 5th Aug 2003
Location: Canada
Posted: 21st Jun 2005 10:19
Quote: "(sorry, but NO, I dont download/use beta versions)"


and i was thinking it's been beta since it first came out.

http://cavesoft.no-ip.com
WIP Version of my site. Usally it is offline.
http://dev-cavesoft.no-ip.com
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 23rd Jun 2005 21:34
Well,.. yeah

//Awards: Best DM at NeverwinterConventionIII (NWCon3)
//Sys: Pentium IV 3200E/Prescott;800Mhz FSB;HT;WinXPPro;ATIR9700PRO;1024MB RAM(2x512MB"DualChanneled";VC++7.net;Delphi6;ADSL512;

Login to post a reply

Server time is: 2024-04-24 23:53:35
Your offset time is: 2024-04-24 23:53:35