This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > VRML > December 2004 > STUPID newbie question - Rotations...
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
STUPID newbie question - Rotations...
|
|
| Chris Flynn 2004-12-21, 7:18 pm |
| OK, I'm completely confused and not thinking straight, so sorry for the
simplicity...
I want an object to be rotated 1.57 rads in the x axis (no probs).
Then I want an orientation interpolator to rotate it in the original y axis
(now the z axis) by 0.5.
The syntax of VRML isn't very clear to me:
rotation a b c d - are a b c just boolean operators, or are do they multiply
with d?
You can't have Transforms inside keyValue it seems, so I tried 1.57 0.5 0 1
for the rotation in the interpolator, to no avail. I've tried creating a 2nd
orientation interpolator and routing my timer to both of them, but this
doesn't seem to work either.
This is screwing with my head when it probably shouldn't be - can anyone
give an explanation?
Many thanks,
Chris
| |
| Braden McDaniel 2004-12-21, 11:15 pm |
| On Tue, 2004-12-21 at 21:36 +0000, Chris Flynn wrote:
> OK, I'm completely confused and not thinking straight, so sorry for the
> simplicity...
>
> I want an object to be rotated 1.57 rads in the x axis (no probs).
> Then I want an orientation interpolator to rotate it in the original y axis
> (now the z axis) by 0.5.
>
> The syntax of VRML isn't very clear to me:
> rotation a b c d - are a b c just boolean operators, or are do they multiply
> with d?
The first three numbers (a, b, c) represent a vector. The fourth number
(d) is a rotation around that vector.
> You can't have Transforms inside keyValue it seems,
Indeed; nodes are only valid in a SFNode or MFNode [exposed]field.
> so I tried 1.57 0.5 0 1
> for the rotation in the interpolator, to no avail.
Each key value in the OrientationInterpolator is a whole rotation value;
that is, they each include the axis component (the first three numbers)
and the rotation component.
--
Braden McDaniel e-mail: <braden@endoframe.com>
<http://endoframe.com> Jabber: <braden@jabber.org>
| |
| Chris Flynn 2004-12-22, 7:19 pm |
| ----- Original Message -----
From: "Braden McDaniel" <braden@endoframe.com>
Newsgroups: comp.lang.vrml
Sent: Wednesday, December 22, 2004 2:21 AM
Subject: Re: STUPID newbie question - Rotations...
> On Tue, 2004-12-21 at 21:36 +0000, Chris Flynn wrote:
multiply[color=darkred]
>
> The first three numbers (a, b, c) represent a vector. The fourth number
> (d) is a rotation around that vector.
>
OK, thanks. Do you know of any good tutorials that may be able to help me? I
just want to rotate by 1.57 in the x axis and 0.535 in the z axis... :(
(both radians)
Cheers,
Chris
| |
| Braden McDaniel 2004-12-22, 11:15 pm |
| Chris Flynn wrote:
> OK, thanks. Do you know of any good tutorials that may be able to
help me? I
> just want to rotate by 1.57 in the x axis and 0.535 in the z axis...
:(
> (both radians)
So you want two rotations: [1 0 0 1.57] and [0 0 1 0.535]. You could
combine them by simply nesting Transform nodes; but that's annoying.
The math involved in combing those into a single rotation is not
exactly trivial; but if you're curious, google for quaternion math.
Basically, you convert the rotations into quaternions and then
multiply. Fortunately, you don't *have* to think about all this:
Script {
field SFRotation r1 1 0 0 1.57
field SFRotation r2 0 0 1 0.535
url [
"java script:
function initialize() { print(r1.multiply(r2)); }"
]
}
Braden
| |
| Braden McDaniel 2004-12-22, 11:15 pm |
| Chris Flynn wrote:
> OK, thanks. Do you know of any good tutorials that may be able to
help me? I
> just want to rotate by 1.57 in the x axis and 0.535 in the z axis...
:(
> (both radians)
So you want two rotations: [1 0 0 1.57] and [0 0 1 0.535]. You could
combine them by simply nesting Transform nodes; but that's annoying.
The math involved in combing those into a single rotation is not
exactly trivial; but if you're curious, google for quaternion math.
Basically, you convert the rotations into quaternions and then
multiply. Fortunately, you don't *have* to think about all this:
Script {
field SFRotation r1 1 0 0 1.57
field SFRotation r2 0 0 1 0.535
url [
"java script:
function initialize() { print(r1.multiply(r2)); }"
]
}
Braden
| |
|
|
| Chris Flynn 2004-12-25, 12:14 pm |
| ----- Original Message -----
From: "Braden McDaniel" <braden@endoframe.com>
Newsgroups: comp.lang.vrml
Sent: Wednesday, December 22, 2004 2:21 AM
Subject: Re: STUPID newbie question - Rotations...
> On Tue, 2004-12-21 at 21:36 +0000, Chris Flynn wrote:
multiply[color=darkred]
>
> The first three numbers (a, b, c) represent a vector. The fourth number
> (d) is a rotation around that vector.
>
OK, thanks. Do you know of any good tutorials that may be able to help me? I
just want to rotate by 1.57 in the x axis and 0.535 in the z axis... :(
(both radians)
Cheers,
Chris
| |
| Braden McDaniel 2004-12-28, 12:17 pm |
| On Tue, 2004-12-21 at 21:36 +0000, Chris Flynn wrote:
> OK, I'm completely confused and not thinking straight, so sorry for the
> simplicity...
>
> I want an object to be rotated 1.57 rads in the x axis (no probs).
> Then I want an orientation interpolator to rotate it in the original y axis
> (now the z axis) by 0.5.
>
> The syntax of VRML isn't very clear to me:
> rotation a b c d - are a b c just boolean operators, or are do they multiply
> with d?
The first three numbers (a, b, c) represent a vector. The fourth number
(d) is a rotation around that vector.
> You can't have Transforms inside keyValue it seems,
Indeed; nodes are only valid in a SFNode or MFNode [exposed]field.
> so I tried 1.57 0.5 0 1
> for the rotation in the interpolator, to no avail.
Each key value in the OrientationInterpolator is a whole rotation value;
that is, they each include the axis component (the first three numbers)
and the rotation component.
--
Braden McDaniel e-mail: <braden@endoframe.com>
<http://endoframe.com> Jabber: <braden@jabber.org>
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|