Archived

This topic is now archived and is closed to further replies.

Freaking confused- rendering curved (bezier) lines

This topic is 5675 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

Ok, I''ve been very enthusiastic about learning how to draw more than choppy polygons, and the first step was to learn how to draw curved surfaces. I went to my local Barnes and Noble and read a few chapters in probably 4 different books (the only one I remember the name of was ''Game Programming Gems I''). Of course, this was probably the wrong direction to take because it confused the heck out of me. Is it really that hard and complicated to render a curved shape? It seems to take a TON of math (which I was pretty much able to understand with my math level). Not only that- but I think a lot of it was dealing with arcs and curved *motion*, which would obviously concern much math. The parts that tried to explain curved lines and surfaces just didn''t click- I read about quaternions, and understood it pretty well, but then it tried explaining spline interpolation of a line and (maybe because my understanding of quaternions is shaky) I was lost. Somehow complex numbers fit into all this. (quaternions are 4-d representations of complex numbers?) Overall, is there anyone willing to simply explain how to render a bezier line? Or at least tell me that if I can''t understand it I need to learn more before I try this...

Share this post


Link to post
Share on other sites
One of the techniques in "Real time Rendering Tricks and Techniques in DirectX" explains how to render bezier surfaces with a vertex shader. Even if you aren''t using shaders, you should be able to extract the important math bits you need for a non-shader implementation.

I''ve found that there is a spectrum between books that explain all the nitty gritty math in gory detail and those that gloss over the deep mathematical proofs but are accessible to non-mathematicians. My explanation falls into the latter category. The practical level of the math is pretty straightforward once you walk through it.

Take a look at the book and let me know if you have more questions.

Also, there are decent articles in the "Articles and Resources" link on this site. That might be a good place to start.

Share this post


Link to post
Share on other sites
Great, I''ll see if I can get my hands on one around here in a bookstore (and read it in the store ). That''s what I needed- just a little guide to something that explains it well and clearly even though it may be using advanced techniques.
I''m assuming I would program my own vertex shader?
I''ll take a look at it. Thanks.

James

Share this post


Link to post
Share on other sites
I wrote the chapter (and most of the others) aimed at shaders, but you don''t have to draw the curve/surface with a shader. You could apply the math and use it to set the vertex values directly.

If you plan on doing a lot of this, you may want to look at David Rogers'' "Introduction to NURBs" book. Although, you may want to buy it because it''s probably not the kind of thing you can digest in a single sitting.

Share this post


Link to post
Share on other sites