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 6259]: How do I...


  • To: software@geom.umn.edu
  • Subject: Re: [Closed REQ 6259]: How do I...
  • From: daemon
  • Date: Wed, 23 Jul 1997 15:14:00 -0500 (CDT)

> I want to to a 3D image of a sattelite and rotate it about its
> axis based on telemetry comming from our ground system.  Can I
>  do this in Geomview with little effort?  What graphics format does
> our CAD section need to give me?

Yes, that may well be pretty easy.  You'll need to construct a 4x4
transformation matrix which encodes the rotation and translational-position
of the satellite.  There's some guidance for this in the geomview manual
and/or the "man 5 oogl" man page.  Matrices are transposed from what you'd
expect of the mathematical convention; they're considered to be multiplied
by row-vector points on the left, rather than column-vector points on the
right.  The translational part appears in the last row of the matrix,
and the rotation is in its upper left 3x3 submatrix.  A couple of examples:

  # Geomview command to load the satellite:

  (geometry Satellite  < "data-file-describing-satellite")


  # Pure translation: put the satellite at (1.2, -1.5, .1),
  # in its native orientation:

  (xform-set Satellite
	1   0    0    0
	0   1    0    0
	0   0    1    0
	1.2 -1.5 .1   1)

  # Put the satellite at (2, 0, 0), rotated 30 degrees around the Z axis

  (xform-set Satellite
	.866  .5  0   0
	-.5 .866  0   0
	  0    0  1   0
	  2    0  0   1)
  
Sending a sequence of xform-set commands will animate the satellite:
the scene will be redrawn for each parenthesized command you send.

If you need code to construct the matrix for a given rotation about an
arbitrary axis, let us know.

As for the data format for the satellite, I think geomview's OFF files
are similar to those other people use; they're very simple, and described
in the Geomview manual and in "man 5 oogl"'s section on OFF objects:

OFF
nvertices  nfaces  nedges   # "number of edges" needn't be correct; use e.g. 0

x0 y0 z0		    # Table of vertices, implicitly
x1 y1 z1		    #   numbered 0 through <nvertices-1>.
..
x<nv-1> y<nv-1> z<nv-1>

nfv  v0 v1 ... v<nfv-1>	    # For each of the <nfaces> faces,
			    # give first the number of vertices on the face,
			    # then that many vertex-indices (each in range
			    #     from 0 through <nvertices-1>), then
			    # (optionally, and on the same line if present)
			    # R G B color for the face (each in range 0 to 1).

A simple OFF object: a square and a triangle, sharing an edge:

OFF
5 2 0

0 0 0
1 0 0
0 1 0
1 1 0
.5 -.5 1

4  0 1 3 2  .95 .5 .5	# Pink square
3  1 0 4    		# Default-colored (i.e. gray) triangle
 

There's also a very-half-baked DXF-to-OOGL converter in the form of a
perl script, available from

  ftp://geom.umn.edu/priv/slevy/dxf2oogl

It works for simple things, but can't deal with DXF hierarchies, etc.

Let us know if you need more...

  Stuart Levy, Geometry Center


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