How to Draw tree using OpenGL


I am using visual stdio … c++

how i can draw tree


I need help >>>

What is that thing that you call a tree anyway? Are you trying to visualize a data structure? Do you want to draw an image of a plant that people commonly refere to as a tree?

OpenGL® is lowlevel rasterization API, not a fancy 3D engine. There is no glDrawTrees( ) function. Using modern OpenGL®, you have allocate a vertex buffer and probably index buffer and load a triangle approximation of whatever you call a tree into that. You have to write a shader program that runs on the GPU to transform the triangles of your “tree” and to determine the color of the pixels once the triangles get rasterized, etc…

If you want to quickly move forward with your one time tree drawing demands, my advice would be to use a highlevel 3D engine like this one or that one.

If you want to learn how to use OpenGL®, it is adviseable to first understand what OpenGL® is and what it is not. If you understand what OpenGL® is, know what triangle rasterization means and have basic understandings of linear algebra, you will easily figure out (after some practice) how to draw a tree by building on top of the OpenGL® API.

As a starting point for OpenGL® tutorials, I would suggest this website.

thank u a lot my dear :o