POV-Ray : Newsgroups : povray.general : alignment! Server Time
2 Nov 2024 06:15:50 EDT (-0400)
  alignment! (Message 1 to 7 of 7)  
From:
Subject: alignment!
Date: 10 Feb 2000 15:11:04
Message: <38A31BFF.1F62D004@relaq.mx>
hi!
I have a cylinder with known xyz's coordinates and I want to align
(rotate then translate?) a cylinder the same length positioned in
(0,0,0) (length,0,0). I can get the angles around X, Y, and Z axis, but
when I apply these angles to my origin cylinder I don't get the right
alignment.
Thanks in advance for your help!!
sa


Post a reply to this message

From: Peter Popov
Subject: Re: alignment!
Date: 10 Feb 2000 17:10:31
Message: <ijOjOPJKQSlTWZZxDzWye3ByOEzA@4ax.com>

<ant### [at] relaqmx> wrote:

>hi!
>I have a cylinder with known xyz's coordinates and I want to align
>(rotate then translate?) a cylinder the same length positioned in
>(0,0,0) (length,0,0). I can get the angles around X, Y, and Z axis, but
>when I apply these angles to my origin cylinder I don't get the right
>alignment.
>Thanks in advance for your help!!
>sa

Sorry for being lazy, I'll just copy-paste a reply I just posted :)

Try John VanSickle's Throroughly Useful Macros. They should be linked
from the links section on povray.org and also included in the macro
package Ken has made available on his site.

Oh, and if you have no idea what I am talking about, see the
announcements group on this server.

Hope this helps.


Peter Popov
pet### [at] usanet
ICQ: 15002700


Post a reply to this message

From: Peter Warren
Subject: Re: alignment!
Date: 11 Feb 2000 06:20:24
Message: <38a3f078@news.povray.org>
Peter Popov wrote in message ...
I wonder if this is a good answer?


Post a reply to this message

From: Josh English
Subject: Re: alignment!
Date: 11 Feb 2000 10:26:43
Message: <38A42A3C.96CE2FC2@spiritone.com>
Are you saying that the first cylinder has two known endpoints and you want
to make a cylinder of the same length along the x axis? In that case, you'd
want to calculate vlength(p2 - p1) where p1 and p2 are the endpoints of the
first cylinder.

If you want the cylinder at the origin to be the same length and go in the
same diretion, use <0,0,0> and p2 - p1 as the endpoints.

If I'm way off it's because I'm not clear as to what you're asking.
Hopefully Peters' suggestion to look at John VanSickles matrix page will
help. Perhaps if you posted some code we could see what you want and what
you're getting...

Josh



> hi!
> I have a cylinder with known xyz's coordinates and I want to align
> (rotate then translate?) a cylinder the same length positioned in
> (0,0,0) (length,0,0). I can get the angles around X, Y, and Z axis, but
> when I apply these angles to my origin cylinder I don't get the right
> alignment.
> Thanks in advance for your help!!
> sa

--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."


Post a reply to this message

From:
Subject: Re: alignment!
Date: 14 Feb 2000 12:30:46
Message: <38A83C7A.D03E840E@relaq.mx>
thanks josh.
i have two identical cylinders. one is somewhere in space (i know xyz of the
end points), the other one is at the origin and along the x axis (one end point
is [0,0,0]; the other end point is [length,0,0]). i need to align the second
one with the first one by means of rotations and translations.
i'm trying to do it with matrices but any help is appreciated.
thanks,
sandra


Josh English wrote:

> Are you saying that the first cylinder has two known endpoints and you want
> to make a cylinder of the same length along the x axis? In that case, you'd
> want to calculate vlength(p2 - p1) where p1 and p2 are the endpoints of the
> first cylinder.
>
> If you want the cylinder at the origin to be the same length and go in the
> same diretion, use <0,0,0> and p2 - p1 as the endpoints.
>
> If I'm way off it's because I'm not clear as to what you're asking.
> Hopefully Peters' suggestion to look at John VanSickles matrix page will
> help. Perhaps if you posted some code we could see what you want and what
> you're getting...
>
> Josh
>

>
> > hi!
> > I have a cylinder with known xyz's coordinates and I want to align
> > (rotate then translate?) a cylinder the same length positioned in
> > (0,0,0) (length,0,0). I can get the angles around X, Y, and Z axis, but
> > when I apply these angles to my origin cylinder I don't get the right
> > alignment.
> > Thanks in advance for your help!!
> > sa
>
> --
> Josh English
> eng### [at] spiritonecom
> "May your hopes, dreams, and plans not be destroyed by a few zeros."


Post a reply to this message

From: Josh English
Subject: Re: alignment!
Date: 14 Feb 2000 19:36:00
Message: <38A89F86.AB47943D@spiritone.com>
i use the following when moving an object aligned to the x axis into space.
ns control the objects local sky value, which should be <0,1,0> but if you rotate
this point around the x axis [vrotate(<0,1,0>,<45,0,0>)] you can change the
rotation of the object at the same time.

#macro Orient_X(v1,v2,ns)
  #local nx = vnormalize(v2 - v1);
  #local nz = vnormalize(vcross(nx,ns));
  #local ny = vcross(nz,nx);
  matrix <nx.x,nx.y,nx.z,
          ny.x,ny.y,ny.z,
          nz.x,nz.y,nz.z,
          v1.x,v1.y,v1.z>
#end



> thanks josh.
> i have two identical cylinders. one is somewhere in space (i know xyz of the
> end points), the other one is at the origin and along the x axis (one end point
> is [0,0,0]; the other end point is [length,0,0]). i need to align the second
> one with the first one by means of rotations and translations.
> i'm trying to do it with matrices but any help is appreciated.
> thanks,
> sandra
>
> Josh English wrote:
>
> > Are you saying that the first cylinder has two known endpoints and you want
> > to make a cylinder of the same length along the x axis? In that case, you'd
> > want to calculate vlength(p2 - p1) where p1 and p2 are the endpoints of the
> > first cylinder.
> >
> > If you want the cylinder at the origin to be the same length and go in the
> > same diretion, use <0,0,0> and p2 - p1 as the endpoints.
> >
> > If I'm way off it's because I'm not clear as to what you're asking.
> > Hopefully Peters' suggestion to look at John VanSickles matrix page will
> > help. Perhaps if you posted some code we could see what you want and what
> > you're getting...
> >
> > Josh
> >

> >
> > > hi!
> > > I have a cylinder with known xyz's coordinates and I want to align
> > > (rotate then translate?) a cylinder the same length positioned in
> > > (0,0,0) (length,0,0). I can get the angles around X, Y, and Z axis, but
> > > when I apply these angles to my origin cylinder I don't get the right
> > > alignment.
> > > Thanks in advance for your help!!
> > > sa
> >
> > --
> > Josh English
> > eng### [at] spiritonecom
> > "May your hopes, dreams, and plans not be destroyed by a few zeros."

--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."


Post a reply to this message

From:
Subject: Re: alignment!
Date: 16 Feb 2000 14:38:26
Message: <38AAFD6D.A700BE83@relaq.mx>
thanks to all!
I did it with the Reorient macro in the VanSickle's Throroughly Useful
Macros.
sa



> hi!
> I have a cylinder with known xyz's coordinates and I want to align
> (rotate then translate?) a cylinder the same length positioned in
> (0,0,0) (length,0,0). I can get the angles around X, Y, and Z axis, but
> when I apply these angles to my origin cylinder I don't get the right
> alignment.
> Thanks in advance for your help!!
> sa


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.