View Full Version : Help ?? How can i draw a tree???

03-12-2004, 06:55 PM
Plese a need help to draw a tree in Opengl, using textures bmp,jpeg

03-13-2004, 03:34 AM
do a search on "billboarding"
www.gamedev.net (http://www.gamedev.net) I think has a tutor on this.

Originally posted by NeoRoland:
Plese a need help to draw a tree in Opengl, using textures bmp,jpeg

03-13-2004, 10:22 AM
Nop , i can't found ??


I need a basic example ,and , how can i load a texture with transparent

please !!! :`( :'(

03-13-2004, 11:30 AM
There are loads of billboarding examples kicking around the web. Try nehe.gamedev.net for one, they've probably got something. Actually, I've just checked, there are no tree examples, but check out lessons 9, 19 and 33 for information relating to what you want to do. For the rest of the info, Google is your friend.

I've just checked and there's a Direct3D sample app that does billboarded trees. I know I'm risking life and limb mentioning the other API here, but you could learn the basic method from there (as long as you remember to fudge your matrices back to the OGL way when you come to build it using OGL http://www.opengl.org/discussion_boards/ubb/smile.gif)

As for transparent textures, you mention bmp and jpgs, neither of those formats supports an alpha channel (well, ok, bmp does, but the spec is so badly formed that nothing works right). Check out wotsit.org and look for a file format description of TGAs. Really easy format, simple RLE compression, and they support up to 32 bit images.

(or just plug libpng into your code http://www.opengl.org/discussion_boards/ubb/smile.gif)

03-13-2004, 06:16 PM
I don't think you tried very hard, I put the words "billboarding" and "openGL".

Here was the first hit:

A tutor on billboarding with openGL.

second hit from google:
another tutor on billboarding and the image use is of a tree

nehe.gamedev.net has a tutor on images with transparency.

[This message has been edited by nexusone (edited 03-13-2004).]

03-14-2004, 07:06 AM
thanks a lot http://www.opengl.org/discussion_boards/ubb/biggrin.gif