objects on terrain
hi,
i have created a terrain using c and opengl. now i wish to place some objects like a tree or cattle on the terrain.
how do i do it? can it be done using opengl??
glBegin(GL_TRIANGLES);drawCastle();glEnd();
Okay, seriously. If you ask an open-ended question like this, you have to expect some pretty open-ended answers.
So. I'd suggest you make a castle or tree in a 3D modeller, like Blender or Milkshape 3D, both freeware and with either very simple file formats or very easy to make custom exporters for. In fact, Blender has a 3DS exporter, and I'm sure there's a half-dozen free 3DS readers out there which produce a model object with built-in OpenGL drawing routines.
Alternatively, you can just draw your castle using hard-coded GL primitives. You know, yourself, what a castle looks like. So make a drawWall() method that draws a wall from (0,0,0) to (1,0,0) and tile or rotate a few of those to make the walls. Make a drawTower() method that draws a tower from (0,0,0) to (0,0,1), and scale a few of those to the size you want. I suggest using a display list or vertex buffer, storing your entire castle into it, and then drawing it with a single batched call later on (after you get your slow prototype working, of course).
sorry for my query being insufficient..
i have a glb model of the object (cattle/man/woman)and a terrain.
what i wanted to know is how do i make model appear on the terrain.
any suggestions..
i have a glb model of the object (cattle/man/woman)and a terrain.
what i wanted to know is how do i make model appear on the terrain.
any suggestions..
Which part are you having problems with - loading the glb model, rendering the loaded model, or positioning the model at the correct place in the world?
Quote:Original post by Hodgman
Which part are you having problems with - loading the glb model, rendering the loaded model, or positioning the model at the correct place in the world?
actually i havent yet started with any of these..so i need help regarding all the parts..
instead of the model i would like to place an image eg. tree.jpg/tree.bmp on the terrain.
can anyone tell me how this can be done.
or else suggest me some site/tutorial for the same.
can anyone tell me how this can be done.
or else suggest me some site/tutorial for the same.
Look up billboards and impostors.
I'm not familiar with GLB files, but you could always try wotsit, a huge repository of information about open and proprietary file formats: http://www.wotsit.org/
As far as getting around to the rendering, if you're drawing a terrain you've honestly already got 3/4s of what you need to know to draw the trees and other objects on it down pat.
I'm not familiar with GLB files, but you could always try wotsit, a huge repository of information about open and proprietary file formats: http://www.wotsit.org/
As far as getting around to the rendering, if you're drawing a terrain you've honestly already got 3/4s of what you need to know to draw the trees and other objects on it down pat.
hi
thats exactly what i want to know. how do i render the tree which is an image jpg/bmp on to the terrain..
first i load the image from the file,
then how do i render it??
thats exactly what i want to know. how do i render the tree which is an image jpg/bmp on to the terrain..
first i load the image from the file,
then how do i render it??
Quote:Original post by vpkBillboards @ Flipcode.Quote:Original post by Wyrframehow do i render the tree which is an image jpg/bmp on to the terrain..Quote:Original post by vpkLook up billboards and impostors.
i would like to place an image eg. tree.jpg/tree.bmp on the terrain.
Billboards @ NeHe.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement