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 / Need help putting more than one texture on my terrain!!

Author
Message
Newbie12321
13
Years of Service
User Offline
Joined: 2nd Jul 2011
Location:
Posted: 2nd Jul 2011 12:42
i have just started learning dark GDK (approx 5 days ago) and i have been following some youtube FPS tutorials

anyways to my point i have made a terrain it is a object in .dbo format and i load it then texture it with dbTextureObject(terrain, terraintex);

and this works however its just sand which it the image i want it to load. how ever i want it so the hills and rocky, there are grass patches, etc but if i do another dbTextureObject it just overwrites my old texture, does anyone know how to make a terrain with little patches of grass all over the place and the hill/mountains being rocky.

thanks i am abit n00b as this is the first 3D thing i have done, i have the first person controls fine but its just the textures that are failing......

dbLoadObject("map//terrain.dbo" ,base);
dbLoadImage("map//40.jpg", grasstxt);
dbTextureObject(base, grasstxt);
SC_SetupComplexObject(base, 1, 2);
SC_AllowObjectScaling(base);
dbScaleObject(base, 150, 150, 150);
SC_UpdateObject(base);

}








thanks in advanced
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 2nd Jul 2011 18:42
I think you're trying to do it the hard way. Take a look at the "Terrain" tutorial in you GDK directory:
\The Game Creators\Dark GDK\Tutorials

I think this is the kind of thing you are looking for. Simply put, you create a texture of the ground (sand,grass etc...) and then you make the "height map" which is a gray-scale impression of the elevation (lower==darker, higher==lighter).

One thing I struggled with is the max size for these textures is 256x256.

There is another texture that is used. This one is for "detail". Adjust the look any way you want and *poof* you have terrain you want.

The fastest code is the code never written.
Newbie12321
13
Years of Service
User Offline
Joined: 2nd Jul 2011
Location:
Posted: 2nd Jul 2011 19:19
thanks, i tried doing this earlier but i was having problems something like error 6, then vc++ 2008 says something about an error and asks if i want to break or continue

i think it might be because i am not setting it up right with my other code i will have another shot, do u know of any good heightmap editors?
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 3rd Jul 2011 02:17
The way this works is that you make a gray-scale texture of the height map.

Did you use the tutorial EXACTLY the way it was written?

The fastest code is the code never written.
Newbie12321
13
Years of Service
User Offline
Joined: 2nd Jul 2011
Location:
Posted: 3rd Jul 2011 15:36
excellent got it working =D thanks i have now typed out the code for making a terrain and and sky box from the tutorial and put my other code into it so now i can use mouse to look around and i made my own sky box with 3ds max, thank alot
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 3rd Jul 2011 17:08
The very uninformative error 6 may mean simply that the program cannot find your images on the disk. Make sure that you either give a correct path or the images are in the current working directory (which is next to the cpp files if you start from Visual Studio and next to EXE if you start outside VS).

Login to post a reply

Server time is: 2024-11-19 09:46:26
Your offset time is: 2024-11-19 09:46:26