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 / Problem loading Dark Matter Model

Author
Message
Fr4gory
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location:
Posted: 12th Jun 2009 17:17 Edited at: 12th Jun 2009 17:22
When I tried to load an Dark Matter model, more specific


It just doesn't show up, I tried a couple other Dark Matter models, they show up in the Directx viewer, but when I load them in Dark GDK, they just don't show up [See Screenshot].

Code uses:



Any Ideas or Suggestions will be highly appreciated. Thank you

Michel Cilissen - CiliSoft Software Solutions
michel@techblog24.com - http://www.cilisoft.tk

Attachments

Login to view attachments
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 12th Jun 2009 23:55 Edited at: 13th Jun 2009 00:00
I haven't used the DGDK for quite some time now, so you will have to forgive me if I get something a little wrong.

Firstly, you are creating a matrix every frame, this should be done once outside of the main loop. Also, when you create a matrix it is positioned at 0,0,0 relative to it's centre (I'm not entirely sure about this, just ignore it if it's created relative to the corner) so you need to position the model at 50,0,50 as opposed to 100,0,100. This is because the matrix is 100 units wide hence 50 units along both the positive and negative X axis.

As for the model, is the model located in the working directory of the application? To confirm that the model is accessible from the working directory, you could just add a bit of debug code, like so:



Edit: Used dbp code instead of C++...

01100001 01101110 01101111 01110100 01101000 01100101 01110010
01110000 01101111 01101001 01101110 01110100 01101100 01100101 01110011
01110011 01110011 01101001 01100111
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 13th Jun 2009 11:19
Do you run the program from the Visual Studio IDE? Even if your media is in the same directory as the executable, they won't be found because the working directory in Visual Studio is different. You can check if the program finds the file by including:



You can set the working directory in Visual Studio by right-clicking the project name, Properties, Configuration properties, Debugging, Working directory. You need to do this both for debug and release configuration. Or, you can devise a system in your game to build relative file paths for your media, for example by using the dbAppName function to find out where the EXE is located.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 13th Jun 2009 11:27
P.S. the matrix is positioned by the corner, but you really don't need to create it every loop, just once before the loop.
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 13th Jun 2009 11:59 Edited at: 13th Jun 2009 12:05
Quote: "P.S. the matrix is positioned by the corner"


I thought it might have been, just wasn't sure and I don't have GDK installed so I couldn't test it.

Quote: "You can check if the program finds the file by including:"


Yeah that's what I suggested too. However, if the application is finding the weapon model then the mutant model should be available in the current working directory, if it's located in the same directory as the weapon. But using the code I and Mireben suggested will check if it's there or not. Plus to be fair, you should always check that files are available/accessible before you try loading them, this makes for safe applications. You can make life easier by wrapping the code up into either a Model class or even just a simple function like so.



Then just use the function like so:



01100001 01101110 01101111 01110100 01101000 01100101 01110010
01110000 01101111 01101001 01101110 01110100 01101100 01100101 01110011
01110011 01110011 01101001 01100111

Login to post a reply

Server time is: 2024-10-01 03:38:55
Your offset time is: 2024-10-01 03:38:55