POV-Ray : Newsgroups : povray.newusers : Calculating rotation from normal Server Time
28 Jul 2024 18:24:46 EDT (-0400)
  Calculating rotation from normal (Message 1 to 4 of 4)  
From: Angela
Subject: Calculating rotation from normal
Date: 19 Jul 2008 23:05:01
Message: <web.4882aa50763e7e7e802286fd0@news.povray.org>
Sorry to post twice in a row. I hope I'm not being annoying... :-) I'm just
really stuck, and I'm sure there's an easy answer, but I can't figure it out.

I have 1) a point in a mesh and 2) a user-defined object created at the origin.
I want to be able to orient the object perpendicular to the mesh surface at the
known point. I know the normal, but I cannot figure out to calculate the
rotation for the object. Can I use the normal to orient the object, or am I
just way off in figuring out how to do this?

Thank you!
~Angela Perry


Post a reply to this message

From: Tim Attwood
Subject: Re: Calculating rotation from normal
Date: 19 Jul 2008 23:57:37
Message: <4882b7b1$1@news.povray.org>
> Sorry to post twice in a row. I hope I'm not being annoying... :-) I'm 
> just
> really stuck, and I'm sure there's an easy answer, but I can't figure it 
> out.
>
> I have 1) a point in a mesh and 2) a user-defined object created at the 
> origin.
> I want to be able to orient the object perpendicular to the mesh surface 
> at the
> known point. I know the normal, but I cannot figure out to calculate the
> rotation for the object. Can I use the normal to orient the object, or am 
> I
> just way off in figuring out how to do this?

NP, post away =)

There are some macros for this sort of stuff in "transforms.inc",
like...
object { foo
   Point_At_Trans(myNormal)
}


Post a reply to this message

From: Angela
Subject: Re: Calculating rotation from normal
Date: 20 Jul 2008 14:40:00
Message: <web.488385ceaa860c0f802286fd0@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> There are some macros for this sort of stuff in "transforms.inc",
> like...
> object { foo
>    Point_At_Trans(myNormal)
> }

That did it! And after looking at the math behind it, maybe it wasn't as easy as
I thought it would be... o_O

Thanks a bunch!
~Angela


Post a reply to this message

From: Alain
Subject: Re: Calculating rotation from normal
Date: 20 Jul 2008 15:40:41
Message: <488394b9@news.povray.org>
Angela nous illumina en ce 2008-07-19 23:01 -->
> Sorry to post twice in a row. I hope I'm not being annoying... :-) I'm just
> really stuck, and I'm sure there's an easy answer, but I can't figure it out.
> 
> 
> Thank you!
> ~Angela Perry
> 
> 
> 
You're not anoying at all. Asking questions is the object of this board after all.
Also, asking one question per post the the recomended way.

-- 
Alain
-------------------------------------------------
Never frown, even when you are sad, because you never know who is falling in 
love with your smile.


Post a reply to this message

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