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 / Displaying Custom Content in MDL or 3DS format with Textures in .tga format...

Author
Message
Holy Cow Coder
16
Years of Service
User Offline
Joined: 8th Sep 2008
Location: Somewhere on Mustafar
Posted: 9th Sep 2008 06:38
I can't seem to get this program to display a custom image, I have all of the proper files in the project, textures, models, etc. but it only shows me a black screen when I compile and Debug the program. Here is what I am trying to do:

// Dark GDK - The Game Creators - www.thegamecreators.com

// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application

// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"

// the main entry point for the application is this function
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );

dbLoadObject("yoda.3DS" , 1);
dbLoadImage("N_Yoda01.tga", 2);

dbMakeObject(3,1,2);
dbTextureObject(1 , 2 );
dbSetObjectLight(1, 1);
dbSetObjectAmbient(1 , 1);



// our main loop
while ( LoopGDK ( ) )
{

dbShowObject(1);

// update the screen
dbSync ( );
}

// return back to windows
return;
}

Any help would be greatly appreciated. I can create the sphere model and texture it and spin it, but this code wouldn't work...why??

"The Dark Side Clouds our vision...Only the Dark Lord of the Sith knows of our weakness. If informed the Senate is, multiply our enemies will." Master Yoda, Episode II.
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 10th Sep 2008 09:28
Yes...
I have had the same problem. Don't use 3ds files, convert them to .x format. 3ds files dont really work that well with DGDK, besides, .x is better for direct x game development.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 10th Sep 2008 13:11 Edited at: 11th Sep 2008 19:34
Yeah, I have had problems loading .3DS files myself, I had some that were modelled and exported from MAX2009, they wouldnt load at all and just crashed the program, on the other hand, ive had other models made in old versions of max and converted to .3DS with "file converters" and they worked fine(sometimes, moral is for me, its been unstable), I can only assume that there are various "implementations" of the .3DS format itself, much as the directX format has expanded and grown over the years from its first form...

My suggestion to solve you problem would be to do some trial and error tests with loading different formats of models and timing your code perhaps to see which format will be best for you..

Start with the natively supported DirectX format .X file, GDK uses directX, and so its support for that format is very good, then when you become familiar with how 3D files are constructed and rendered etc, perhaps you could work on building your own "importer" code.

I know a number of 3D app's have SDK's that are related to reading and working with their native file formats( MAX with .FBX, XSI with dotXSI Crosswalk etc etc ), these SDK's can make it very easy to utilize a 3D app's native file format in your programs without converting it to another format and having to worry about loss of detail in the file, such as complex shader/material relationships. The advantage of this is that you get into your program, exactly what is designed in the 3D app, as long as you know how to read the file, using the SDK...

Of course, actually writing and implementing your own 3d file import code, would firstly, be very complex in itself, even with a specially designed SDK API, working it into the GDK would be a task unto itself, and secondly, I dont think that its something that should be attempted unless you have very good knowledge of programming in the C++ language natively and with the GDK, aswell as working with 3D files at the coding level( Its something that I am looking at doing, although I know I have a whole lot of learning to do before I attempt it...)

EDIT : There is a great tutorial in GDK C++ written by Mike Johnson showing exactly how to load and create custom media, you can find the thread stickied at the top of the DarkGDK forum.

If it ain't broke.... DONT FIX IT !!!
Holy Cow Coder
16
Years of Service
User Offline
Joined: 8th Sep 2008
Location: Somewhere on Mustafar
Posted: 11th Sep 2008 23:12
Thanks for the input from both of you, I converted the 3DS file from MDL and MBX files with NWMax for 3DS Max 9 64-bit, then exported it as a 3DS file. I am not sure which plugin I can find to convert these files (3DS) into .X format. If anyone knows of a good freeware program that does this, please let me know, I would appreciate it. Thanks.

"The Dark Side Clouds our vision...Only the Dark Lord of the Sith knows of our weakness. If informed the Senate is, multiply our enemies will." Master Yoda, Episode II.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 12th Sep 2008 05:51
Panda DirectX exporter for MAX..... it is probably the only directX exporter for max(at least the 09 version, it supports from MAX4.2 to the current versions and is free) that i have found that supports more than a single UV texture set( can have upto 8 with panda), and all of the other directX format templates.. meaning i can export models with more than 1 texture set on em and not have to re-wrap em outside my 3D app, wasting my time in the process... plus it seems to write the directx format and support it very very well, will allow you to export to DirectX format straight from MAX... no more external converter programs(said converteres I dont really like, they always seem to lose some data somewhere and it takes me yonks to find/fix)

If it ain't broke.... DONT FIX IT !!!
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 12th Sep 2008 23:25
There's a program called "Quick3D". You can get a free (if not annoying sometimes, it has 2 pop-ups when opening and closing) version that can open almost any 3D format and save almost any 3D format. And view them, too.

Login to post a reply

Server time is: 2024-09-30 05:41:30
Your offset time is: 2024-09-30 05:41:30