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.

DarkBASIC Professional Discussion / Code for calling Terrain

Author
Message
Gadget
16
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 27th Jun 2010 09:28
Hello Everyone,

I am having a hard time figuring out how to implement my terrain into DBP. Here is what I have done so far...

I created my terrain in a different terrain editor and exported it as a .obj then I used ac3d to convert it to a .3ds.

So from what I understand I need to put it into code using the load object command. Is this correct? If so, what code do I put in to start seeing it? If somone could please provide me with some example code or even a demo that I can see the source code as an example that would be great.

I searched the forums and found very little info on what to do once I have the terrain created and none of what I found helped. I have attached my terrain file for anyone to use to help me out. Thanks in adv for the assist.

Gadget
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 27th Jun 2010 10:06 Edited at: 27th Jun 2010 10:11
The code to load your terrain should be as simple as this.

load object "terrain1.3ds",1

Which is the file name followed by the object number you want to use for it.
This code snippet should load it and allow you to view it from any position with the mouse.


unfortunatley as soon as you un-comment out the part that loads your terrain object the code crashes,is it possible for you to save your terrain as a .x format model as some 3ds exporters do seem to have a problem exporting in a way that DBPro can understand some times.
If not then post the obj file you have and i will convert it and test it for you.
Gadget
16
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 27th Jun 2010 11:10
I will give that a try in the morning. Thanks for the quick reply. That 1 line you gave me is whatI put in but since I did not know what to do after that it wouldn't load. Here is the .obj file. Can you recommend a converter to .x as the terrain editor I use does not support .x? Thanks again.

Gadget
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 27th Jun 2010 16:09
Exactly what terrain editor are you using to create this,i have tried all the apps/utilities that i have for converting both the 3ds and obj file you have provided.
Most will load and let me view the obj file,some will let me do the same for the 3ds file,but all seem to give some sort of warning along with it,and none of them will export me a useable .x format file.
I can only think its a fault with the original export routine from your editor,what would it save them as default? would that be a simpler file to convert?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Jun 2010 18:38
I've just imported the map.obj file into MilkShape 3D and exported it as an X file using the DirectX 8 exporter. The resulting X file loads cleanly into DBPro (I'm using DBPro U7.4 for some odd reason).

I attach the X file I was using - it uses a texture of mine but you can easily change that. I also rotated it so it followed the usual DBPro convention that the Y coordinate represents the vertical dimension.
Gadget
16
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 27th Jun 2010 19:40
The app I used was one recommended in another thread called Nem's mega 3d terrain creator. It's a nice little app so I hope it will work for this purpose. Thanks for the efforts guys.

Gadget
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 27th Jun 2010 19:53
Thanks GG,thats the one app i dont have to try it with,but why DX8 instead of 9?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 28th Jun 2010 00:52
Quote: "but why DX8 instead of 9?"


No idea - it was the only x file exporter I could find in MS3D (although I'm sure there's another ). It worked which is the main thing.

Login to post a reply

Server time is: 2026-07-25 08:13:46
Your offset time is: 2026-07-25 08:13:46