go to www.geomview.org home page



Mailing List

Geomview For Windows?


Bug Reporting
Contact Us



Site Search



About the software@geom archive

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

Re: 4d simplicial complex

> Thanks for your reply.
> Let me describe the scenario I will be dealing with me. If you
> can suggest the best approach, it might save me some effort.
> Given a triangulation T of a 4-dimensional point set and a
> parameter p, my program generates a simplicial complex K(p)
> which is a subset of T. I wish to "visualize" K(p). May also
> want to observe its 3-dimensional slices.
> Does my program, running as an external module, have to produce slices?

So far, yes.  We've talked about adding N-D slicing to geomview but
haven't actually done anything yet.  The "4Dview" module will do slicing,
but you have to manually load the 4-D (4OFF, 4VECT, etc.) object from a file;
it can't automatically take slices of a dynamically changing object.

> What about viewing its projection in 3-space orthogonal to a given vector?

Each cluster of N-D cameras has some location and orientation, given by a
basis matrix; camera projections are of the world as transformed by that
matrix.  So by correctly choosing the camera's orientation, you can
project in any direction.

You can do this kind of thing under program control, if you construct your
own orthonormal basis matrix for the space orthogonal to that vector.
Suppose the vector is (.5, .5, .5, .5); then one such basis would be

  0.772  -0.154   0.000  -0.617  # Camera's X axis in the world (a row vector)
 -0.333   0.667   0.000  -0.333  # Y
 -0.289  -0.289   0.866  -0.289  # Z
  0.500   0.500   0.500   0.500  # W

(I've got code to produce an orthonormal basis if you don't already have
some lying around.)

Then, you could tell geomview to orient a camera this way, and display the
world's projection on the first three vectors, with

(dimension 4)			# Set dimension
(camera fred {})		# Create camera named "fred"
				  # (do this iff fred doesn't already exist)

(ND-axes fred  cluster1  0 1 2) # Display the first three axes

(ND-xform fred {		# Set camera-to-world transformation for "fred"
	5 5			# (and for any other cameras in cluster1)
	  0.772  -0.154   0.000  -0.617   0
	 -0.333   0.667   0.000  -0.333   0
	 -0.289  -0.289   0.866  -0.289   0
	  0.500   0.500   0.500   0.500   0
	  0	  0	  0	  0	  1
  } )

Note the matrix is 5x5, with an extra row and column of 1's; this is because
we use homogeneous coordinates.  A camera translation could appear in the
bottom row.

> What about rotation about a given axis?

Remember that in spaces of dimension > 3, you can't rotate about a line
(i.e. preserve projections along some line while changing things in the other
dimensions).  You can always rotate in a plane, though.

One ugly way: manually construct a sequence of matrices, sending ND-xform
commands for each one.

A better way: you can specify rotations with respect to the coordinate
system of some object.  So I think the following should work:

Create a dummy object:
	(geometry sam {})
Set its transform so that, say, the first two rows (the object's X-Y subspace)
define the plane to rotate in, and the remainder form some orthonormal basis:
  (ND-xform sam {
	5 5
	  0  0  0  1  0		# Let's rotate in the W-X plane
	  1  0  0  0  0
	  0  0  1  0  0
	  0  1  0  0  0
	  0  0  0  0  1
   } )

Now, the geomview "transform" command lets you specify 3-D rotations, etc. in 
sam's coordinate system.  The following rotates the world by 45 degrees
(.785 radians) about sam's Z axis, i.e. rotates in sam's X-Y plane,
i.e. rotates in the world's W-X plane:

   (transform world world sam  rotate  0 0 .785)
or for a continuous rotation of 45 degrees every 2 seconds:
   (transform-incr world world sam  rotate  0 0 .785  2)

> What would be the best way to "pipe" data into Geomview
> if my program is running on a different machine (a Sun,
> for example)?

The easiest way to get the data across will be with the "rsh" (remote shell)
command; see its man page if it's unfamiliar.

Given that, are a couple of ways to do this.

1) Your program could be an "external module" to geomview.  In that case, put
a command in the file .geomview (in the current directory when you run it,
or in your home directory), containing something like

  (emodule-define  'My Program'  'rsh somesun "cd somewhere; myprog args ..."')

A line reading "My Program" will appear in Geomview's Modules browser;
clicking on that line invokes the "rsh somesun ..." shell command.  
Anything "myprog" writes to its standard output (e.g. with printf())
is interpreted as a geomview command.  [You may not need the "cd somewhere"
business; that's just for illustration.]

A limitation with this style is that you can't interactively supply 
arguments to your program -- it just sees whatever you've coded into the
emodule definition.

2) Your program could invoke geomview remotely.  In its simplest form:

    myprog args | rsh someiris togeomview

Here again, the standard output of "myprog" is sent to geomview and interpreted
as lisp-style commands.  The program "togeomview" starts a copy of geomview
(or connects to an existing copy) and pipes geometry or commands to it.

Alternatively "myprog" could contain something like
    FILE *f; ...  f = popen("rsh someiris togeomview");
and send geomview commands to the file "f" rather than stdout.

In any case, remember to call fflush(stdout) (or fflush(f)) after sending a
command to ensure geomview actually gets it!


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