Creating a spiral path for text

Software: Away3D 3.x

Vortextual, Newbie
Posted: 12 July 2011 04:02 AM   Total Posts: 1

As part of the project I am working on I am attempting to run a section of vector text along a 3d spiral (effectively a spring).

However I am completely stumped as to how to create the path.
I have done various tests with simpler curves and aligning the text to these with the pathalignmodifier class - but I am completely stumped when it comes to creating a path that follows a spiral/spring shape.

I had thought that I could create a spring object with the latheextrusion class and then use this as a basis for the text path, but whilst I have successfully created the spring I am having no luck finding a way to create a path based upon the shape.

Any advice would be most helpful!

   

Avatar
theMightyAtom, Sr. Member
Posted: 12 July 2011 06:11 AM   Total Posts: 669   [ # 1 ]

Hi Vortextual, sounds like the shape you want is a helix.
You’ll be glad to know the maths are quite straight forward.
You’re basically drawing a circle with a Y component that increments in a linear fashion. The code would look something like:

var angle = 0;
var rad = 100; // radius of your helix
var stretch = 10; // the amount the helix is “stretched” per increment

xpos = Math.sin(angle) * rad;
zpos = Math.cos(angle) * rad;
ypos = angle * stretch;

Then you just need to increment the angle (which would be in radians) and collect the results into an array.

Hope that points you in the right direction, otherwise google “helix formula”

Good luck!

   

Vortextual, Newbie
Posted: 12 July 2011 12:46 PM   Total Posts: 1   [ # 2 ]

Thanks for this.
I’ll see what I can do with it today.

Cheers.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X