Re: polygon question

Gavin Bell ([email protected])
Fri, 17 Nov 1995 18:08:35 -0800


On Nov 17, 12:06pm, J Gwinner/VisNet, I wrote:
> I wish there were an extension node that would
> specify radians, gradians, mils (old Artillery usage), or degrees. No
biggie
> though.

The VRML 1.something prototyping mechanism will give you what you want:

Here's the definition and use of a "DRotation" extension node that is like
the Rotation node, but allows specification of an axis and an angle in
radians, using the syntax of the SGI behavior proposal:
(http://reality.sgi.com/employees/gavin/vrml/Behaviors.html)

# Declaration of rotation with axis, and angle specified in degrees:
PROTO DRotation [ input SFVec3f axis IS CONVERT.axis,
input SFFloat angle IS CONVERT.angle ]
Rotation {
rotation = DEF CONVERT Logic {
input SFVec3f axis 1 0 0
input SFFloat angle 0
output SFRotation result
script "... script that esads axis/angle in degrees,
and produces the SFRotation result"
}.result
}

DRotation is defined, so you could then use it like:

DRotation {
axis 1 0 0
angle 90
}
Cube { }
... to rotate the cube 90 degrees about the X axis.

Footnote: I don't think this example is critical (I don't think this is a
fundamental requirement of a behavior system for VRML), but I don't think it
can currently be done with the other leading VRML behavior proposal
(http://earth.path.net/mitra/papers/vrml-behaviors.html); but maybe I just
don't understand the proposal well enough. Any of you want to take a shot at
it?


  • Next message: [email protected]: "desubscribe www-vrml"
  • Previous message: James Waldrop: gRe: What program supports behaviors?"