Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: How to Draw tree using OpenGL

  1. #1
    Newbie Newbie
    Join Date
    Mar 2014

    Lightbulb How to Draw tree using OpenGL


    I am using visual stdio ... c++

    how i can draw tree


    I need help >>>

  2. #2
    Member Regular Contributor Agent D's Avatar
    Join Date
    Sep 2011
    Innsbruck, Austria
    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(R) is lowlevel rasterization API, not a fancy 3D engine. There is no glDrawTrees( ) function. Using modern OpenGL(R), 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(R), it is adviseable to first understand what OpenGL(R) is and what it is not. If you understand what OpenGL(R) 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(R) API.

    As a starting point for OpenGL(R) tutorials, I would suggest this website.
    Last edited by Agent D; 03-12-2014 at 05:58 AM.

  3. #3
    Newbie Newbie
    Join Date
    Mar 2014
    thank u a lot my dear

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts