Sign in to follow this  

Draw with Vertex

This topic is 4421 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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]).

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

Can you provide me more information on this matter?

johntvery@operamail.com

johntvery@hotmail.com

Share this post


Link to post
Share on other sites

This topic is 4421 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this