Draw with Vertex

Started by
3 comments, last by GameDev.net 18 years, 5 months ago
how to find vertex? if i want to draw a tree How to do this? do i need to install some special softwares to draw it and find its vertex location?
Advertisement
I think I understand your question.

OpenGL just lets you draw triangles in 3D. It is up to you to put lots of triangles together and make shapes and recognizable figures out of them. If you want to draw a tree, you can either think of some way to arrange the triangles algorithmically, and write the code to do this, or you can load a model that will do it for you. However, even loading a model isn't straightforward - it's up to you to make (or download somewhere) the code to load the model, and to display it properly using openGL. You can try to look for tutorials on "blender c++" (a free program) or "3ds c++" (if you have 3d studio max) and go from there.

There's a lot you can do without model files. Try looking up a "heightmap landscape". It just depends on your imagination, and math & programming abilities.
Ultimately, down the road, the only way you are going to draw a tree is read in a model file like the above poster said.

But you know, you can draw a tree with a sphere on top of a cylinder, can't you? Read the specs on GLUQuadricObj and how to use them, and then you can draw a simple tree without model loading or long hours of triangle drawing. [smile]

But if you're really serious about the tree, download a modelling program, learn how to use it and import models from it into OpenGL. I'd also vote for Blender (just because I've been using it [wink]).
Or, if you just want a picture of a tree facing you, you could get even simpler

You can draw whats called a billboard, with a texture of a tree on it...

the Billboard is just a rectangle(2 trianlges) with a texture mapped to it, and when the camera changes(the angle at which you are looking at the tree), you just turn the rectangle to be always facing you... very simple, and very quick...

although you will have to find out how to rotate the rectangle, but that'll be the hardest part...

Can you provide me more information on this matter?

johntvery@operamail.com

johntvery@hotmail.com

This topic is closed to new replies.

Advertisement