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 / DarkGDK 3D Object Limb Counter

Author
Message
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 29th Aug 2008 09:20
Ok, after playing around with the GDK and 3D objects and animation, and also the Dark Physics plugin, I noticed that if the model you are using isnt one that you have created yourself, getting information about the limbs, to be able to reference them in your own program can be a painful process...

To that end, I wrote a little piece of code that will simply load a 3D Object, assign it as dbObject 1, display it to the screen(if possible) and iterate thru its limb name's and number's, displaying that information to the screen also.

The Code is very very simple, and also very very inefficent and full of bad programming practices, written only for the a simple purpose, there are probably many better ways to do this, however, the code is heavily commented, from the point of view of explaining each step of what the program is doing...

I have included the Main.cpp file from the project as an attachment to this post, feel free to download it and add it to a project of your own..

The Code is very self-explanatory :



If you have any questions, ideas for improvements, or just an overriding need to tell me how bad my code is, then feel free to PM me @ Mista Wilson...

If it ain't broke.... DONT FIX IT !!!

Attachments

Login to view attachments
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 29th Aug 2008 16:18
Opps.... the above code snippet has a set of line :

// point the camera initially at our object change to suit
dbPositionCamera((dbObjectSizeX(1)-dbObjectPositionX(1)), (dbObjectSizeY(1)-dbObjectPositionY(1)), (dbObjectSizeZ(1)-dbObjectPositionZ(1))); // -- uncmoment this line to place the camera where u want, fill the values appropriately
dbPointCamera( dbObjectPositionX(1), dbObjectPositionY(1), dbObjectPositionZ(1) );
dbText(0,0, "

Comment out the bottom line of that .. this code was orignally longer and did other things, i reduced it to post here, looks like i forgot to finish deleteing a line or 2 Sorry...

If it ain't broke.... DONT FIX IT !!!

Login to post a reply

Server time is: 2024-09-30 05:36:20
Your offset time is: 2024-09-30 05:36:20