|
|
I'm really using triangles, but to get the point across I use disc.
Triangles will be used to create the tube where one triangle's vertex will
be at a point on the circumference of the disc, and the two other vertices
of the triangle will be at two points on the circumference of the next disc
locate at the next point along the spline.
--
Mike
wk: mik### [at] pyxiscom www.pyxis.com
hm: mwe### [at] sciticom www.geocities.com/mikepweber
"ryan constantine" <rco### [at] yahoocom> wrote in message
news:38E13E2A.A5EF47B0@yahoo.com...
> sorry, no math help here, but why are you using disks? wouldn't spheres
work?
> rotation wouldn't matter then would it?
>
> Mike Weber wrote:
>
> > I have a question for a problem relating to 3D rotations.
> > I'm working on a bspline plug-in dll for Moray. Its very close to being
> > ready for release once I get this small problem fixed.
> >
> > So here it is:
> >
> > I'm creating a tube like object for the spline by using a series of
'discs'
> > along the path of the spline and orientating its surface or normal to
point
> > to the next joint or point along the spline. Using the following math
and
> > trig functions that Sean Worle provided:
> >
> > rz = atan2(dx, dy);
> > rx = atan2(sqrt(dx*dx + dy*dy), dz);
> >
> > atan2 = arctangent of y/x (in radians)
> >
> > where dx, dy, dz are the differences between the current point and the
next
> > point in the spline.
> > rz and rx are the amount to rotate the disc in the z and x axis. The
disc
> > is created in the X-Y plane.
> >
> > The problem is when I create a b-spline object along the Z axis, which
looks
> > like a straigt cylinder (or tube) - it is fine. But if one of the
points
> > moves in the x direction, then the disc is rotated by 90 degrees along
the Z
> > axis which is not good. But it does this because when using atan2 and
the
> > dx goes negative it returns -90.
> >
> > I certainly would appreciate any help. I can provide pictures if
needed.
> >
> > --
> > Mike
> >
> > wk: mik### [at] pyxiscom www.pyxis.com
> > hm: mwe### [at] sciticom www.geocities.com/mikepweber
>
Post a reply to this message
|
|