POV-Ray : Newsgroups : povray.off-topic : Ok, someone explain this in English... (exploring quaternions) : Re: Ok, someone explain this in English... (exploring quaternions) Server Time
7 Sep 2024 09:20:50 EDT (-0400)
  Re: Ok, someone explain this in English... (exploring quaternions)  
From: Patrick Elliott
Date: 2 Jul 2008 01:01:04
Message: <MPG.22d4b95918d5d18798a174@news.povray.org>
In article <4868a1bc@news.povray.org>, sco### [at] laptopcom says...
> > Well. Was more wondering if there was some "sane" way to handle them
> > without having the convert them at all. Basically, you do something
> > like:
> >
> > a = llGetRot(me);
> > b = llGetLookAt();
> >
> > then either do 'llSetRot(a*b);' or 'llSetRot(b);', depending on if you
> > want to try to preserve "any" of the original orientation. The problem,
> > of course, is simply that 'b' is not oriented to the same up/down or
> > even top/bottom as 'a' in the first place. So, you either have to delet
e
> > one of the angles, then apply, or convert to Euler, switch them around,
> > then convert back to Quaternian, and *then* apply. The first method
> > seems to be impractical, or impossible, take you pick, due to how the
> > the stuff works. Its seriously annoying.
> 
> The 2nd method you propose seems feasible.
> 
> I would rotate the "forward" direction of your model (eg the axis vector
 
> (1,0,0)) by the quaternion "a".  Maybe your script language lets you do t
his 
> just with a *, if not you need to look up how to rotate a vector by a 
> quaternion - it's not hard or expensive.
> 
> Then with this vNew, you can work out the two rotation angles, limit them
 to 
> whatever ranges you see fit, then create a new quaternion from these angl
es.
>  
Yeah. I know that will work, but it adds more math and function calls, 
which means more script execution to do it, and thus "possibly" added 
lag on the server end, where the script runs. Its a catch-22.

-- 
void main () {

    if version = "Vista" {
      call slow_by_half();
      call DRM_everything();
    }
    call functional_code();
  }
  else
    call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models,
 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

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