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 / Loading Issue

Author
Message
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 2nd Sep 2008 02:01 Edited at: 2nd Sep 2008 02:02
Hey all!

I seem to be having an issue with loading a 3d Model. The Model is in my game directory and I'm trying to follow the tutorial that comes with DarkGDK on 3d Objects and the program works however, the model I am trying to load is not showing up I've tried several different camera positions to try to find my model but I just can't locate it. Here is my code:

Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 2nd Sep 2008 08:58
Any suggestions?
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 2nd Sep 2008 11:07 Edited at: 2nd Sep 2008 11:09
"dbFileExist ("Models/Girl.x");"

This statement isn't doing anything here as it merely returns a 1 if the file exists, and 0 if it doesn't, you aren't even using the return value, but assuming the file exists...

"dbPositionObject (1, 70, 70, 30);"
"dbPositionCamera (0.0f, 70.0f, 30.0f);"


This will position the camera to the right of the object, it might be beneficial to position it at the object but subtract 2x the object size(dbObjectSize(ID)*2.0f) from the camera's z axis position, this should allow you to see it. If not then check if the object exists as GDK doesn't really have any fail-safe code to tell you if any function failed. If you still can't see it, output the dbObjectSize() and if the number is really high, i.e. the object is huge you may wish to increase the far clipping plane of the camera, to something like dbSetCameraRange( 0.1f, 100000000.0f ); etc. If you still can't view it then find a copy of the DirectX SDK's MeshView tool, this allow you to view any .x file so you can check if the outputted file is even valid. If you have an older version of this app you can re-save the model into a format that GDK should handle without issues, I use this all the time as GDK is rather fussy about what types of .x it wants to load.

Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 2nd Sep 2008 21:06 Edited at: 2nd Sep 2008 23:11
Hey thanks Darkcoder I will give this a try.

The mesh is valid it opens up in the DirectX Viewer but why can't I see the object in DarkGDK?
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 2nd Sep 2008 23:19
Okay I have placed the camera right where the Model would be and still nothing lol.
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 7th Sep 2008 08:06
Didn't work
nrasool
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Surrey Area
Posted: 7th Sep 2008 12:18
Should the following



be



Note the double slashes, I remember in some version of C++ I had to do this. Please try that and remember to put the same in fileexist

A Good Programmer never blames his tools
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 9th Sep 2008 00:17
Okay I will try this as well.
Mike J
Retired Moderator
18
Years of Service
User Offline
Joined: 7th Jul 2006
Location: Binghamton, NY, USA
Posted: 9th Sep 2008 01:18
Try using backslashes in your file name path instead of foreslashes...?

"The early bird may get the worm, but the second mouse gets the cheese."
Sausen Kenny
15
Years of Service
User Offline
Joined: 4th Oct 2008
Location:
Posted: 5th Oct 2008 15:10
Mike J and nrasool is right

or try rechecking your folder and file directory make sure that
their in the right place

Login to post a reply

Server time is: 2024-09-30 05:21:55
Your offset time is: 2024-09-30 05:21:55