POV-Ray : Newsgroups : povray.general : alignment again. Server Time
31 Oct 2024 16:16:07 EDT (-0400)
  alignment again. (Message 1 to 8 of 8)  
From: Sandra Antúnez
Subject: alignment again.
Date: 19 Feb 2000 23:52:05
Message: <38AF73B1.DD24AACE@relaq.mx>
hi all!
I have to align a three point object (with point1 in <0,0,0>, point2 in
<x,0,0>, and point3 in <x,y,0>), with an identical three point object in
space (with known xyz coordinates for the three points). is there an
easy way to do it (like the reorient macro in the vansickle page)? or a
not so simple one?
thanx,
sa


Post a reply to this message

From: Mark Wagner
Subject: Re: alignment again.
Date: 20 Feb 2000 01:03:14
Message: <38af83a2@news.povray.org>

>hi all!
>I have to align a three point object (with point1 in <0,0,0>, point2 in
><x,0,0>, and point3 in <x,y,0>), with an identical three point object in
>space (with known xyz coordinates for the three points). is there an
>easy way to do it (like the reorient macro in the vansickle page)? or a
>not so simple one?
>thanx,
>sa


If you are using the MegaPatch, the following will work:
#declare V1 = point2-point1; /* These are the points of the object */
#declare V2 = point3-point1;

#declare New1 = NewPoint2 - NewPoint1; /* NewPoint1, NewPoint2, NewPoint3
are the positions you want to move the object to */
#declare New2 = NewPoint3 - NewPoint2;

object{MyObject
  REORIENT(V1, New1) /* This is VanSickle's Reorient macro, or anyone else's
reorient macro */
  REORIENT(vtransform(V2,_REORIENT(V1, New1)), New2)
}

This will also work without the MegaPatch, but you will need to figure out
the math for the vtransform function yourself.

Mark


Post a reply to this message

From: Sandra Antúnez
Subject: Re: alignment again.
Date: 21 Feb 2000 01:32:48
Message: <38B0DCDA.4A5FE9BC@relaq.mx>
ok. and what is and where can I get the megapatch?
thanx,
sa

Mark Wagner wrote:


> >hi all!
> >I have to align a three point object (with point1 in <0,0,0>, point2 in
> ><x,0,0>, and point3 in <x,y,0>), with an identical three point object in
> >space (with known xyz coordinates for the three points). is there an
> >easy way to do it (like the reorient macro in the vansickle page)? or a
> >not so simple one?
> >thanx,
> >sa
>
> If you are using the MegaPatch, the following will work:
> #declare V1 = point2-point1; /* These are the points of the object */
> #declare V2 = point3-point1;
>
> #declare New1 = NewPoint2 - NewPoint1; /* NewPoint1, NewPoint2, NewPoint3
> are the positions you want to move the object to */
> #declare New2 = NewPoint3 - NewPoint2;
>
> object{MyObject
>   REORIENT(V1, New1) /* This is VanSickle's Reorient macro, or anyone else's
> reorient macro */
>   REORIENT(vtransform(V2,_REORIENT(V1, New1)), New2)
> }
>
> This will also work without the MegaPatch, but you will need to figure out
> the math for the vtransform function yourself.
>
> Mark


Post a reply to this message

From: Ken
Subject: Re: alignment again.
Date: 21 Feb 2000 02:08:36
Message: <38B0E427.B3875188@pacbell.net>

> 
> ok. and what is and where can I get the megapatch?
> thanx,
> sa

MegaPov is a patched version of POV-Ray that has all of the features
the official version does plus new features the official version does
not have - yet. In this case it combines many different patches all
into one. You can read more about and download MegaPov at the following
site - http://nathan.kopp.com/patched.htm

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Sandra Antúnez
Subject: Re: alignment again.
Date: 22 Feb 2000 13:09:45
Message: <38B2D1BB.2EA40C20@relaq.mx>
it worked!!!!
thanks again!
sa

Mark Wagner wrote:


> >hi all!
> >I have to align a three point object (with point1 in <0,0,0>, point2 in
> ><x,0,0>, and point3 in <x,y,0>), with an identical three point object in
> >space (with known xyz coordinates for the three points). is there an
> >easy way to do it (like the reorient macro in the vansickle page)? or a
> >not so simple one?
> >thanx,
> >sa
>
> If you are using the MegaPatch, the following will work:
> #declare V1 = point2-point1; /* These are the points of the object */
> #declare V2 = point3-point1;
>
> #declare New1 = NewPoint2 - NewPoint1; /* NewPoint1, NewPoint2, NewPoint3
> are the positions you want to move the object to */
> #declare New2 = NewPoint3 - NewPoint2;
>
> object{MyObject
>   REORIENT(V1, New1) /* This is VanSickle's Reorient macro, or anyone else's
> reorient macro */
>   REORIENT(vtransform(V2,_REORIENT(V1, New1)), New2)
> }
>
> This will also work without the MegaPatch, but you will need to figure out
> the math for the vtransform function yourself.
>
> Mark


Post a reply to this message

From: Sandra Antúnez
Subject: Re: alignment again.
Date: 22 Feb 2000 13:31:36
Message: <38B2D6DB.611C0058@relaq.mx>
it worked!!!!
thanks again!
sa

Mark Wagner wrote:


> >hi all!
> >I have to align a three point object (with point1 in <0,0,0>, point2 in
> ><x,0,0>, and point3 in <x,y,0>), with an identical three point object in
> >space (with known xyz coordinates for the three points). is there an
> >easy way to do it (like the reorient macro in the vansickle page)? or a
> >not so simple one?
> >thanx,
> >sa
>
> If you are using the MegaPatch, the following will work:
> #declare V1 = point2-point1; /* These are the points of the object */
> #declare V2 = point3-point1;
>
> #declare New1 = NewPoint2 - NewPoint1; /* NewPoint1, NewPoint2, NewPoint3
> are the positions you want to move the object to */
> #declare New2 = NewPoint3 - NewPoint2;
>
> object{MyObject
>   REORIENT(V1, New1) /* This is VanSickle's Reorient macro, or anyone else's
> reorient macro */
>   REORIENT(vtransform(V2,_REORIENT(V1, New1)), New2)
> }
>
> This will also work without the MegaPatch, but you will need to figure out
> the math for the vtransform function yourself.
>
> Mark


Post a reply to this message

From: Sandra Antúnez
Subject: Re: alignment again.
Date: 23 Feb 2000 15:42:51
Message: <38B44721.44C42003@relaq.mx>
well, I thought it worked but it didn't.
I think there's something wrong with the vtransform part (I'm working with
megapov 0.4). what does it actually do?

here is my code:
// p2-p1-p3 (p1 is the central point)
// p1 =  < 5.076621, 5.713426, -1.745696>
// p2 =  < 4.703301, 6.268358, -2.430469>
// p3 =  < 5.634149, 6.302207, -1.237040>
#declare v1 = <0.9572,0,0>;
#declare v2 = <-0.239987, 0.926627, 0>;                 // x=(0.9572 *
cos104.52), y=(0.9572 * sin104.52)
#declare new1 = <-0.37332,  0.55493, -0.68477>;  // newpoint2 - newpoint1
#declare new2 = < 0.55753,  0.58878,  0.50866>;   // newpoint3 - newpoint1

  object { myobject
    Reorient(v1, new1)
    //AxisRotate(new1,71) this one works but i don't know how to get the 71.
    Reorient(vtransform(v2, Reorient(v1, new1)), new2)
    translate < 5.076621, 5.713426, -1.745696>
  }

thanks,
sa

Mark Wagner wrote:

> If you are using the MegaPatch, the following will work:
> #declare V1 = point2-point1; /* These are the points of the object */
> #declare V2 = point3-point1;
>
> #declare New1 = NewPoint2 - NewPoint1; /* NewPoint1, NewPoint2, NewPoint3
> are the positions you want to move the object to */
> #declare New2 = NewPoint3 - NewPoint2;
>
> object{MyObject
>   REORIENT(V1, New1) /* This is VanSickle's Reorient macro, or anyone else's
> reorient macro */
>   REORIENT(vtransform(V2,_REORIENT(V1, New1)), New2)
> }
>
> This will also work without the MegaPatch, but you will need to figure out
> the math for the vtransform function yourself.
>
> Mark


Post a reply to this message

From: Chris Huff
Subject: Re: alignment again.
Date: 23 Feb 2000 16:02:55
Message: <chrishuff_99-595386.16041723022000@news.povray.org>
In article <38B44721.44C42003@relaq.mx>, Sandra Antunez 
<ant### [at] relaqmx> wrote:

> well, I thought it worked but it didn't.
> I think there's something wrong with the vtransform part (I'm working 
> with megapov 0.4). what does it actually do?

Just what it sounds like: it transforms a vector. If you tell it to 
rotate, it will rotate. If you tell it to scale, translate, or apply a 
matrix to a vector, it will do it. You can also hand it a group of 
transforms in a transform {...} block.
I have never used it in this way, with the Reorient macro as a 
parameter, although I don't see why it wouldn't work. I will take a look 
at your code later and try to see what is going on.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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