Skip to main content
GameDev.net gamedev.net
🔒 Locked

World building ....

Started by Metal Typhoon Jun 19, 2002 at 5:55 PM 5 replies 600+ views
Original Post
Metal Typhoon
Metal Typhoon
first of i dunno how to do a world.. but this is my first thought about it.. parallel lines running along Z axis and others running along the x axis , also parallel. But i can''t think of how to texture these "squares" .. can some one help me out.. Or if u have a better way of doing a world plese fell free to post it thx in advance
Metal Typhoon

Metal Typhoon
SporadicFire
SporadicFire
depends on what you wanna do...obviously world isn''t just bunch of lines... I mean it could serve as a nice base, but you need stuff on top (depending on type of game)..walls,mountains etc...

if you want terrain (as in hills/peaks etc.) you probably wanna use height map and determine height of points from a 2 dimensional arrays... But yes, if you just mean a flat base to put everything on, you can use quads by intersecting 2 sets of parallel lines.
Dwarf with Axe
Dwarf with Axe
Well you can do it with squares if you wanted to; But then you would really be creating a tile engine.

Basically, you want to create a square with texture coordinates, then do the following:

for(int x=0; xfor(int z=0; zDrawTile(x,y);
}
}

You could also replace that DrawTile(..) function for a call to glTranslated(x,y) and then draw the tile.


If you really want to learn how to do terrains, you want to look into height maps. What a heightmap is, is loading image data from a bitmap, then making the height of your terrain equal to the corresponding brightness of the pixel on the bitmap.

Query google for "opengl heightmap tutorials" and "introduction to heightmaps".

Hope this helped,
~Dwarf

[edited by - Dwarf with Axe on June 19, 2002 9:23:38 PM]
Metal Typhoon
Metal Typhoon
quote:
Original post by Dwarf with Axe
then making the height of your terrain equal to the corresponding brightness of the pixel on the bitmap.

[edited by - Dwarf with Axe on June 19, 2002 9:23:38 PM]



u mean like a grey scale height ?? like those apps such as bryce do ?? Do big companies use height maps in game like quake or a "closed world" ?



Metal Typhoon



Metal Typhoon
Dwarf with Axe
Dwarf with Axe
I had the same question and had to answer this myself.

If I worked for a professional game company, I would cheat.

I would load the bitmap data into memory, then write it into a file (with some file extension that I made up) and claim it to be an original file. In truth, it is, Im just using the bitmap data.

Im not sure what bryce is, but if you can think if a bitmap with blots of white in it, each of those blots mark a point in your map where the height would be equal to how bright that pixel was.

~Dwarf
CaptainJester
CaptainJester
If you check this thread, you can download the full source to a good heightmap engine.

---
Make it work.
Make it fast.

"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][
zedzeek
zedzeek
>>u mean like a grey scale height ?? like those apps such as bryce do ?? Do big companies use height maps in game like quake or a "closed world" ?<<

heightmap quake - no
but some games do, in fact most outdoor ones with a resonable sided landscape

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.