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 / help with terrains

Author
Message
locomustard
13
Years of Service
User Offline
Joined: 9th Aug 2010
Location:
Posted: 9th Aug 2010 22:00
I am at a lost as far as making terrains go. could someone help understand how to make a terrain in dgdk i am using 3d world studio.
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 9th Aug 2010 23:28
Well the included Terrain tutorial should help, you should be able to find it in: C:\Program Files\The Game Creators\Dark GDK\Tutorials\Terrain

Surely with 3DWS you can just export your terrain with a heightmap etc and use it in the same way?

Learning DarkGDK for phun.

AMD X2 7750, 2GB, 250GB HD, Nvidia 9600GT, XP SP3 & Ubuntu
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 10th Aug 2010 00:58
You can also export your 3DWS map as a .dbo or .x and load it in with dbLoadObject().
Export is in the FILE menu in 3DWS.

locomustard
13
Years of Service
User Offline
Joined: 9th Aug 2010
Location:
Posted: 10th Aug 2010 19:42
ok, I went through the tutorial for terrains. I did exactly what the tutorial said to do and i got an error message 5. What does that mean?
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 10th Aug 2010 20:48
@locomustard:

Can you give us more information? Can you write out or screenshot the error message.

Learning DarkGDK for phun.

AMD X2 7750, 2GB, 250GB HD, Nvidia 9600GT, XP SP3 & Ubuntu
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 10th Aug 2010 22:10
I think that means you have not got the heightmap in the correct place and your terrain is not getting built.
Your heightmap image should be in your project folder, where you main.cpp file is.

locomustard
13
Years of Service
User Offline
Joined: 9th Aug 2010
Location:
Posted: 11th Aug 2010 01:30
I have attatched the screenshot and here is my code:

//terrain
dbLoadImage("grass1.bmp",1);
dbLoadImage("snow1.bmp",2);
dbSetupTerrain();
dbMakeObjectTerrain(1);
dbSetTerrainHeightmap(1,"island2.bmp");
//dbSetTerrainScale(1,1000,100,1000);
dbSetTerrainLight(1,0,-1,2,255,255,255,1);
dbSetTerrainTexture(1,1,2);
dbBuildTerrain(1);

and inside the inner game loop i update the terrain just like in the tutorial.

Attachments

Login to view attachments
locomustard
13
Years of Service
User Offline
Joined: 9th Aug 2010
Location:
Posted: 11th Aug 2010 07:48
my code is the same as in the tutorial.

Attachments

Login to view attachments
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 11th Aug 2010 21:39 Edited at: 11th Aug 2010 21:39
Do you have those images in the correct place?
You can't just copy and paste when you are loading external media, you need to also copy the media over to the project.

Right click on the main.cpp tab above your code and select "open containing folder", the 3 bmp images need to be in this folder.

locomustard
13
Years of Service
User Offline
Joined: 9th Aug 2010
Location:
Posted: 11th Aug 2010 23:49
yes all my media is in that folder.
locomustard
13
Years of Service
User Offline
Joined: 9th Aug 2010
Location:
Posted: 13th Aug 2010 07:59
i figured it out. my heightmap was too large (6400 x 6400).

Login to post a reply

Server time is: 2024-07-02 09:42:59
Your offset time is: 2024-07-02 09:42:59