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.

Newcomers DBPro Corner / help with terrain or grass

Author
Message
spiffy
18
Years of Service
User Offline
Joined: 3rd Jan 2006
Location: why r u askin
Posted: 2nd Mar 2006 19:59
can some1 help me im bored with a simple matrix can some 1 teach me how to give a hilly affect with some terrain or grass or something and send me a file with a peice of terrain and tell me how to load it into my software

thxs

spiffy

QUACK!! WHAT IS THIS
DB newbie
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 2nd Mar 2006 21:41
to do the hilly effect you just need to randomize the matrix and to add grass just texture the matrix.


i would recomend that you use a object for a landscape instead.

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
General Sephiro
19
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 3rd Mar 2006 02:14
matrix's = slow use an object.. i create landscapes with Anim8or
http://www.anim8or.com <-- linkie

then use sparky's Dll for the collistion i dunno how many times i've referred to it being VERY useful + handy

spiffy
18
Years of Service
User Offline
Joined: 3rd Jan 2006
Location: why r u askin
Posted: 4th Mar 2006 20:44
how do u texture objects then so i can try & texture some grass
like can i have code to randomise to matrix to make it hilly and how to texture it

QUACK!! WHAT IS THIS
DB newbie
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 4th Mar 2006 22:55
look in the help file under matrix i would help you more but im in a rush.

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 5th Mar 2006 00:04
you could use hieghtmaps... even though i dont know how 2 use them
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 5th Mar 2006 00:49
Is it really that hard to try entering "Texture" into the help file search that comes with DB, or the search on this website for the forums?

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th Mar 2006 16:22
always search the code base.
here is red eyes make hill function and give it negative values so do you get an pond or sea.
http://www.thegamecreators.com/?m=codebase_view&i=7783710d9695a8231695373c280aedd7
DB newbie
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 5th Mar 2006 19:26
when i said to use the help file i ment us eit to look for the hightmap stuuf and randomize the matrix.

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
eyequeue
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: My Desk
Posted: 6th Mar 2006 14:46
You could make a terrain using the Make Terrain command.
You can set the terrain's height using a heightmap.
First... Make a new image in Paint Shop Pro or other image software.
Whatever size you set the image to will be your terrain size. Just make sure you make the image a perfect square (eg 1024 X 1024). The dimensions you set the image to will be the terrain size in your program.
Set the image color depth to 256 colors (in Paintshop Pro...Image menu > decrease color depth > 256 colors). Set the image to "greyscale" (image menu > Greyscale).

Flood fill your image with the darkest color available. This will level your terrain when it's loaded. Color the areas you want raised with lighter shades of grey. The lighter the grey, the higher the hill.
Save your image as a jpg, bmp, or any other supported image type.

In DarkBASIC. Use the terrain command MAKE TERRAIN followed by the terrain number (1) and finally, the heightmap you just created.

*** MAKE TERRAIN 1,"heightmap.jpg"

you can also position the terrain...

*** POSITION TERRAIN 1,X,Y,Z

hope this helps

The code is also in snippet form

Windows:
At Least The hour Glass Works
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 7th Mar 2006 03:54 Edited at: 7th Mar 2006 03:57
Randomize the matrix:
that will randomize every vertex on matrix 1 to any height 50 and below.

Texture the matrix:
the extre two 1s at the end of the Prepare command tell it not to stretch the image every tile. The three 1s at the Set Matrix Texture command stand for Matrix Number, Texture Mode (1=on), Mip Mode (1=on; we like mip mode )

Now update the matrix (this part is tricky)


FunkyStickmen: Battle of the Races (1%)
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 7th Mar 2006 10:28 Edited at: 7th Mar 2006 10:42
heres a very simple stress test toy I knocked up under the new u6 patch, you can walk around with mouselook and cursor keys, press space to get an overhead view and "b" to track a bee as it flies about, note the "plants" waving in the breeze, the code is below and the exe is in the zip file (yeah! I aint no artist), note this was just a quick stress test NOT an example of well written and optimised code.



this uses a matrix and plains aimed at the camera, two sliding textures (one ghosted and one solid) for the sea, one transparent and ghosted for the sky, two textured spheres for the suns, several cloned objects for the bees,trees and rocks and several cloned animated objects walking about with rudimentary AI, the trees are static (and all the same model scaled and rotated for variety) the sea and plants both run under their own seperate sine/cos offsets, the plants point at the camera x/z but their own y to stop them leaning over as you aproach em, I was using a matrix because the real game has deformable terrain, (this looks nothing like the real game BTW) , this a quick and dirty attempt at a busy "world", no optimisation was used, click the download button to get a zipped exe that should work on any decent machine (I did virus scan it, but check it yourself before unzipping/running), cheers.



Windows: 32 bit extension/graphical shell for a 16bit patch to an 8bit OS originally coded for a 4bit CPU, written by a 2bit company that can't stand 1bit of competition, now available in 64bits.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-24 17:40:44
Your offset time is: 2024-09-24 17:40:44