Noob OpenGL polygon question

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  07 July 2005
Noob OpenGL polygon question

I'm trying to create a tree model using L-system and OpenGL/C++. What I did was instanciating a series of tapered cylinders in a tree shape. I achieved this through popping and pushing into position matrix. But the final product has unpleasant looking joints. I wanna smooth out the connecting joints and make them look less obtrusive. Any ideas would be greatly appreciated.
  07 July 2005
One way would be to use piecewise Bezier curves, but beware it will smoothen out the details very much
  07 July 2005
If you don't want to create a parametric tree at runtime, you should really consider using an external model format like e.g. 3ds or create your own thing. I guess nobody really works with those glut primitves except for training and testing reasons.

If you want to create a paramtetric tree at runtime, well, have fun. You will have to use nurbs / bezier surfaces, subdivision surfaces or something similar, but all of this is quite tricky to handle. One thing for example is managing the texture coordinates at Y branches.
I guess there are some papers around this theme on citeseer ( ).
  07 July 2005
One of our programmers did this for creating the whomping willow for harry potter 3. The tree's branches were basically lots of dynamic curves which were skinned at render-time.

While the solution wasn't perfect, it did the job. The guy first skinned the curves by extruding squares along them. He then projected the end-points of joining branches onto the main branch to find out where to add new vertices to the main branch in order to create a smooth join. The branches were rendered as subdivision surfaces in prman, but you could do a couple of iterations of subdivision yourself to smooth the branches out.

Texture coordinates were a problem, and there's not really a perfect solution for it, especially at junctions. In the end we just used one set of uv's based on the length from the root to the tip, and another repeating set based on world-space distance along the branches. I shaded the branches using mostly procedural noise, blending in a little bit of tiled textures, but I couldn't use the textures very much because the uv's weren't great.

You can have your characters photoreal, fast or cheap. Pick two.
  07 July 2005
Thank you for all inputs. and yes I am trying to create a tree at runtime for my thesis, which isn't very pleasant to do. I don't know why I bothered with this topic. I will definitely look into bezier for more aesthetic looks. Thanks again guys.
  07 July 2005
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 02:30 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.