We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Drawing a ribbon (Read 606 times)
Drawing a ribbon
Mar 17th, 2008, 5:44pm
 
Hey,

I'm attempting to draw a ribbon in 3D using a Quad Strip.

What I want to be able to do is to draw a line with the mouse and have a ribbon be drawn along the path, but I want the ribbon to be able to rotate depending on the angle of the line drawn.

I have most of that sorted, but the thing I'm having trouble with is calculating the points for the rotation given that I'm not directly rotating about the X, Y or Z axis.

Could anyone give me some advice of how to calculate this?

If my explanation isn't good enough, please let me know and I'll try to clarify.

Cheers
Re: Drawing a ribbon
Reply #1 - Mar 18th, 2008, 3:19am
 
i hope this sketch helps you.
http://www.geocities.jp/classiclll_newweb/KAMEonPlanet/applet/index.html

see codes in "KAME".
Re: Drawing a ribbon
Reply #2 - Mar 18th, 2008, 9:03pm
 
Hmm.. I've got a quad strip being drawn- is there a way to draw elements of the strip with the coordinate system being affected by translate and rotate commands?

Because if vertices are drawn, rotation and translation don't have an effect on the co-ordinates it seems?

Is there any way that I can use the rotate/ translate commands to help me with the drawing of the strip?

I hope this makes sense...

Thanks for your help

EDIT:

I assume that I will have to make a function to calculate the rotated vertex points instead?
Page Index Toggle Pages: 1