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 / Handle to the objects, lights, cameras, etc. ?

Author
Message
Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 18th Aug 2012 21:42
Hello,

How do I get handle to the object created using objects present in a scene or lights or cameras ?

Thanks,
Mister Fuzzy
13
Years of Service
User Offline
Joined: 27th Feb 2011
Location: XNA
Posted: 19th Aug 2012 00:15
I'm sorry, I don't quite follow. Are you looking to retrieve an object's ID? It's origin? Position? A limb?

It's been fun: So long, TGC!
Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 19th Aug 2012 01:28
Suppose I add a camera, a .x animated object, a limb attached to the object, few lights etc. in my scene.

Now what I want is the DirectX handle for each of them so that I can use C++ and DirectX API code to work upon them ( objects, cameras, lights, limbs etc. ) without using Dark GDK functions any further.
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 19th Aug 2012 04:43
Quote: "Now what I want is the DirectX handle for each of them so that I can use C++ and DirectX API code to work upon them ( objects, cameras, lights, limbs etc. ) without using Dark GDK functions any further."

You could probably use sObject struct returned by GetObject(), but at that point you might as well just use straight DirectX or another DX wrapper instead of DarkGDK.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 19th Aug 2012 14:48
DirectX doesn't have a notion of objects, cameras, etc.

[b]
Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 19th Aug 2012 15:37
So, how can use DirectX code to manipulate the loaded objects in the scene ?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th Aug 2012 16:08
You can just call dx9 draw functions anywhere in your game loop and it will be presented to screen when dbSync() is called.

So you can create/load models any way you wish.

To manipulate dark basic objects you can do this:
sObject *obj = dbGetObject( id );

There is information on the dbo format somewhere, I think it might come with DBPro.

You can also create cameras and lights and completely bypass DarkGDK, not done this much so can't help there.

Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 19th Aug 2012 18:47
@Matty H: Thank you for the inside tip. I will look into it.
Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 19th Aug 2012 19:56
@Matty H: This command - dbGetObject( id )

is not listed in the Dark GDK 2.0 chm help file !

Where can I find detail documentation regarding this command ?

Secondly does this command work for all types of objects - 3D meshes, lights, cameras etc.

What is the return data type - sObject ? Is that a C structure ?

Where can I get details about that structure ?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th Aug 2012 20:06
For GDK2 you need to add the command yourself, here are some instructions:

dbGetObject()

There is not much info on the sObject structure, but you can access meshes, limbs and bones etc. Meshes are sMesh[] and limbs are pFrame[] I think.

As far as I know you cant do it with lights or cameras, but I wouldn't be surprised if you could get pointers to GDK lights and cameras through DirectX, or perhaps you could just delete the default GDK light and camera and make your own with the DirectX API.

Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 19th Aug 2012 20:37
Quote: "For GDK2 you need to add the command yourself, here are some instructions:

dbGetObject()

There is not much info on the sObject structure, but you can access meshes, limbs and bones etc. Meshes are sMesh[] and limbs are pFrame[] I think.

As far as I know you cant do it with lights or cameras, but I wouldn't be surprised if you could get pointers to GDK lights and cameras through DirectX, or perhaps you could just delete the default GDK light and camera and make your own with the DirectX API."


So, is this an undocumented function that is not formally disclosed by TGC ? Is this function available in Dark GDK 1.0 and Dark Basic Pro by default ? Or do I have to add them manually ?

Can I get the DirectX device handle that Dark GDK ( both 1.0 and 2.0 ) and Dark Basic Pro is using at run-time ?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th Aug 2012 21:32
You can check the DarkGDK header files for all undocumented commands eg..
dbGetDirect3DDevice() returns a pointer to the device.

Not sure about DBPro but they are disclosed for GDK1 in the header files but you will need to add them yourself for GDK2 for now at least.

Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 19th Aug 2012 21:43
Thank you Matty being of such a help.
Juggernaut
12
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 20th Aug 2012 02:42
Thank you too Dar13.

Login to post a reply

Server time is: 2024-04-25 12:03:31
Your offset time is: 2024-04-25 12:03:31