Advertisement

Making Terrian

Started by November 12, 2000 07:59 PM
7 comments, last by Fillbert 24 years ago
I wanted to know how you would go about making a 3d terrian in openGL and also how to change the potion and angle of the camera, if there are any good tutorials can you please point me too them. Thanks -fillbert
Not to be rude, but maybe you should learn OpenGL first before you worry about terrain rendering, which is a totally different concept. I''m assuming that you don''t know OpenGL (much) because you asked about changing the position and angle of the camera.

For a quick answer on that, you can use gluLookAt() (I won''t explain all the parameters right now, but do a search on it), which will position the camera and set the viewpoint. OR, you can do glTranslate*()''s and glRotate*()''s until you get the view you want, but I prefer gluLookAt().

For more opengl tutorials, check out, of course, nehe''s site : nehe.gamedev.net.

Bye,
Martin
______________Martin EstevaolpSoftware
Advertisement
Hey everyone out there, this is a newbie speaking. I know we (the newbies) are numerouse, and we seem to bug you people who know what they are doing without end. But please, please, please, please, please, we don''t know what were doing, and we know it. We don''t need you guys telling us this everytime we ask for a little help. I don''t want to start any fights, or anything like that. But whenever I send in a few questions, and hoping for atleast a couple general answers, and maybe something else to look up on the net, it seems that people reply, but only to trash my slowly developing opengl skills. Yeah, there are you nice guys out there, I''m not talking about everyone. I do get answers, and good references. But it would be nice, if I wouldn''t have to dig through all the crap to find it. Sorry if I ruffled a few peoples feathers, or made a few people upset/offended. Its the truth. And after reading a reply made by someone to a newbie''s question, it just set me off. Sorry, its just the way I am.

The Kid

I don''''t know what the future holds, but I know who holds the future.
I don''t know what the future holds, but I know who holds the future.
it''s a valid response though, i mean he''s green asking questions about how to do something that requires quite a bit of understanding. no one is trying to be rude when they respond saying ''maybe you should learn this instead'' because it''s true, he should.

otherwise people may try something that''s just beyond their head (at the moment) and it could frustrate them into throwing the in the towel.

so when you ask questions try not to take things personally, while some people are rude others are just trying to help. take it for what it''s worth. for that matter some advice from ''non newbie'' programmers is the exact opposite, there is alot of bad information out on the internet.

my own advice is for the original poster to learn how to take things a step at a time. it''s important to be able to task out what it is you want to accomplish.

it''s just much easier to tackle issues when they are clearly laid out in front of you. so if he can attack one or the other first then things will move smoothly. if he''s trying to do both at the same time his project is going to suffer.

it makes sense to start with opengl, get it to render a simple box on the screen, and evolve just like the projects do here. in the end he''ll come to a point when he wants to do terrain rendering and he''ll have all the skills he needs to see it on screen, being able to concentrate solely on the terrain and not both.

my two cents.

Hey, didn''t mean to bash fillbert or anything. I was just trying to help. I felt that maybe he would get frustrated in trying to learn how to render terrain when he doesn''t know how to move the camera. Best thing is to take it one step at a time; it''ll make the ride a lot smoother

Bye,
Martin
______________Martin EstevaolpSoftware
Terrain Tutorial (the quickest way)

I started with terrains about a week ago... This is what I''ve come up with .. (Since I''m not going to use the algorithms out there, FUCK THAT learning on your own is so much better ).

First create a Height map.. A 2D array of heights (or points on the y axis).. I''ve been creating height maps of about 128x128. You do this with randomized values for the heights (between certain RANGES).. but make sure you look at the previous point and the point next to it for their heights and base this new height off it. ie.

((previous + nexto)/2) * rand()) = newheight

or something like that. then when you have these points loaded in the array (use a console App to check you are getting good numbers) you will want to plot simple lines to view the outline of your terrain. So start at (0, 0, and the first [0][0] of your height array) then increment through the height array and connect the lines for each row of the array. Now that you have plotted the outline you will want to build triangles between the points. and you will have genereted a terrain.. so a recap.

1). Generate a 2D array of heights
2). start at a point and increment along the z by a certain amount (I suggest .2, for a detailed map) while incrementing along the x also
for(x) {
for(z) {
drawline from
(x, [j], z) to
(x, [j+1], z) <br> }<br>}<br> Basically<br>3). Between these points draw a triangle… <br><br><br>*NOTES: <br>Recently I want to make the tops of my hills smoother and not so jagged so what you can do is base your amount along z on the height.. so the higher the height difference between consequtive points the larger the z incrementation. This create ranges with broad mountain tops.. Or you can change all sorts of stuff..<br> Range values for the height.. values along z axis or x axis. <br><br>This is from my personal experimentation and I haven''t looked at any professional algorithsm.. but.. oh well.. good luck this produced some stuff for me.. <br><br>Also someone told me to look up pnoise WHICH IS VERY USEFUL!!!!<br> </i>
Advertisement
I tried looking for PNoise on glVelocity but no luck (?? =\ )..

Could you give me the exact link? Thanks.
Try Perlin noise. Google will give you a bunch of links for
Perlin noise.
You can do that height array thing but you should probably use beziar curves for generartion I dunno if you''re there in the tutorials yet but it makes it a lot easier and gnerates really realistic looking terrains wothout making a model!



Open mouth, insert foot

This topic is closed to new replies.

Advertisement