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 / please help how to get .x file into darkgdk on to screen

Author
Message
stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 6th Jan 2009 21:40
Hi guys, if anyone can help me i would be soooo happy.
I cannot get a direct x model into the screen.
All i wanna do is get a 3d model a cube with 6 different colour sides into my program and be able to rotate it..
I can not display any direct .x files y not ???
I am trying to use directx file created via truespace.

Pleezeeeee help thank you
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 6th Jan 2009 23:10
Where is the broken code or the model you are trying to load?

--Jason

stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 6th Jan 2009 23:28
hi Jason the .x file i am trying to get loaded is in the same directory as other files i am loading ie background image.

I am not really sure exactly which files are needed along with the .x file if any.

I know its a pain in the ...

If you or anyone could supply a lttle code to simply
load in a .x file and display it this may help me with my problem.

Thank you for reading my post :- Steve
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 6th Jan 2009 23:41


Make sure the working directory is what you think! e.g. double Clicking the EXE while it's still in the Debug or Release directory might give an issue .. copy the exe to same dir as the media if running from explorer, command line etc.

--Jason

stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 7th Jan 2009 03:46
that does not work :-(

I dont know what the problem is

How do i know if i have a .x file that dbGDK will display ??
I do not know what it requires and i understand that there are many variants of directx files .......
Please can you tell me where i could get a dirextx file something simple but known to work, so i can take that route and see if that is the problem ' i have a file that is simply not displayable'

thanks for your help i really appreciate that..........

Steve
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Jan 2009 03:49

Attachments

Login to view attachments
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 7th Jan 2009 04:05
Make sure you do dbAutoCamOff();, it happened to me once where it wouldn't display the objects...
stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 7th Jan 2009 04:13
Thank you for your reply about dbAutoCamOff();
tried but still not working ...
Would it be a pain of me to ask if anyone could
send me a known working .x file say a cube with different colours on it and a simple piece of code to display that .x image on screen and rotate it. If i could get that and it still does not work then i could follow a different route.
I would know then it was nothing to do with my code, or the object i am trying to display........

thank you guys for your help :- Steve
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Jan 2009 04:20
I just sent one - look at my previous post - there is a download button.

stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 7th Jan 2009 04:33
thank you jason for the tank sorry did not spot the download button, i must need glasses lol !!!!
It still will not show on screen. i can look at the tank with directx viewer and it appears as a red tank but nothing on the screen. I am so sorry to go on about this problem i dont wanna hog the forums... This is a stumbling block for me........
not being able to get .x files onto the screen as you may imagine.
Could i ask if you or some one could write a simple piece of code that starts from scratch and simply puts a designated .x file onto the screen and rotates it. I must be doing something wrong somewhere regarding what i need to do to get it visible or something..... THANK YOU :- Steve
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Jan 2009 04:51
You're Welcome

Now - change the path to where your media is. I recommend forward slashes too. I find less issues with them, as the back slashes are also escape charaters... better to have mydir/somefile then mydir\\somefile if you ask me




stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 7th Jan 2009 05:12
Thank you for that code snippet.

Created a new program based on the code you gave me
has no errors on debug-start debugging, then just comes up with a blank screen............

I put the tank into this folder

C:\Program Files\The Game Creators\Dark GDK\Media\Models\tank.x

I renamed the file to you sent me to "tank.x"
It beats me totally why nothing is displaying :- Steve
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Jan 2009 05:16
copy the exe file you made to the directory with the tank in it you specified. Then run it using explorer. I think you'r ehaving a file/path issue.

--Jason

stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 7th Jan 2009 05:30
YES YES YES it works if i put exe file into same folder as the tank. . Now i have a nice red tank rotating
I have been scratching my head on this for days now i feel some progress has been achieved. What seems odd i have used the same path as the main code for other things say a background i loaded in, and .mid and mp3 files they load/ run ok and that works but not the .x files ?

What do i need to do to make the path correct as far as
C++ is concerned what would the normal way to set this up.

Many thanks to you Steve
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Jan 2009 05:40
The exact path has to be known... this is what I do...

I have a C++ project compiling and running. The folder with the *.CPP file I'm writing is what I cosider my "root". I make a folder named media. In there I have:

models,
sounds,
whatever... then in the program I load like this:

"./media/models/tank.x"

... for example

Now running inside Visual Studio means that this directory with the *.cpp file is normally the working directory. If you close down Visual Studio and want to run your program directly, copy it out of the debug or the release folder up one to where the *.CPP files are (and media is a sub directory like I described...).

you should have better luck now.. ALSO... learn how to test if a file exists... I think its dbFileExist() or something - search the help... but testing for the file before the load can make things easier to solve... like...



stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 7th Jan 2009 05:51
Thank you very much you have been a great help to me.
I guess now its onto the next issue i have Re: .x files
but that would be another thread i guess
Many thanks if i lived near u i would buy you a beer
Regards :- Steve
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Jan 2009 05:56
You're welcome - for some code you examine like a demo - try: http://code.google.com/p/darkgdk/

I don't expect you to understand that monster entirely - but it could serve as a good reference with example that at least compile and run (as long as you don't install the nov08 GDK update LOL)

--Jason

DnB
15
Years of Service
User Offline
Joined: 28th Feb 2009
Location:
Posted: 2nd May 2009 18:48
I had a problem veiwing .x files also in Dark GDK. I made and exported them in truSpace (awesome program by the way, especially since its free) And thanks to the person who said I had to export them at the position 0, 0, 0, from truSpace. They seem to be working great now. I am not even sure if that was in this particular forumn.. But it is now!!

Login to post a reply

Server time is: 2024-09-30 15:31:22
Your offset time is: 2024-09-30 15:31:22