go to www.geomview.org home page
 
Home

Overview
FAQ
Documentation

Download

Mailing List

Geomview For Windows?

Support
Users
Development

Bug Reporting
Contributing
Contact Us

Sponsors

 

Site Search

 

Advanced
Search

 
About the software@geom archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Closed REQ 6281]: Rotations in Geomview


  • To: software@geom.umn.edu
  • Subject: Re: [Closed REQ 6281]: Rotations in Geomview
  • From: daemons <daemon>
  • Date: Fri, 15 Aug 1997 16:14:45 -0500 (CDT)

>    I am a fourth year engineering student at the 
> University of Virginia and I am developing an external
> module for Geomview which can be used to visualize the
> solutions to optimal control problems involving reorientation
> of objects.  I have run into a small problem however because
> I can not figure out how Geomview calculates the rotation
> matrix from the supplied angles when more than one angle is 
> given in a transform command, such as:
> 
> 	(transform g1 g1 g1 rotate 0 -pi/2 pi/2)
> 
> I had assumed that it would first perform the rotation about one
> axis and then the other but this is not the case.  

Right, it does something different.  What it does is to generate a rotation
about an axis whose direction space is given by the vector you supply.
The amount of rotation (in radians) is given by the magnitude of the vector.  

If you really want to specify rotations as products of X-, Y-, and Z-axis
rotations (in some order!), there'd be a couple of choices:
  Give multiple "transform" commands, one for each axis, as in
    (transform g1 g1 g1 rotate 0 -1.5707 0)
    (transform g1 g1 g1 rotate 0 0 1.5707)
  or, construct the individual matrices yourself, multiply them
    together, and use the "xform" or "xform-set" commands;
  or, use quaternion arithmetic to multiply the rotations,
    then turn the resulting quaternion into the axis-with-magnitude
    form geomview wants, and use "transform" once.

In case you care about just how geomview constructs a rotation matrix 
given the above vector, it's in the source code, in
  src/lib/geometry/transform3/tm3rotate.c
where the function Tm3Rotate() assumes that the caller has already
determined the magnitude of the vector, and is passing that as the angle.

> 	Also, I have noticed that once a command file is read in there
> is no wat to stop the execution of the commands. Is this true and if not,
> how does one go about terminating the execution of the commands without 
> exiting Geomview?

Sure enough, there's no way.

Generally if you want to have an interruptible sequence of commands,
you simply wouldn't send them all at once.  Most existing geomview
modules which do animation contain a loop like this:

  - send command to geomview to take one animation step
  - send "(echo ok\\n)"
  - wait for "ok" to come back (the module sees it arrive on standard input)
  - send another command, etc.

or, for a more-efficient variant, you could send the "echo" 
*before* the command(s) that do the work, so that you'd feel free to send
another command as soon as work has *begun* on the previous one.

Programs like this, if they have a graphical UI, would presumably also
wait for e.g. a Stop button to be pressed while awaiting geomview's
acknowledgement.  Thus in case the user tries to stop -- or changes some
animation parameter, or whatever -- the program can ensure that the
geomview display is at most one step behind.

> 	I thank you in advance for any time and consideration that you 
> are able to devote to these questions. 

> Sincerely,
> Felix Galbis-Reig

Thanks for your interest, and good luck.

  Stuart


 
Home | Overview | FAQ | Documentation | Support | Download | Mailing List
Windows? | Development | Bug Reporting | Contributing | Contact Us | Sponsors
 
site hosted by
SourceForge Logo