Program Summary
| Filename |
plusdraw.pl
|
| Author |
Marvin Simkin
|
| Program Created |
2003-05-20
|
| Last Updated |
Jan 28 13:05
|
| Purpose |
plot plus signs for VR images
|
| syntax |
plusdraw.pl [length] < plus.xyz | drawiv.pl
|
| length |
how long to make the short lines, in your world units, default 0.2
|
| plus.xyz |
list of X Y Z coordinates
|
Discussion
This lets you put markers at specified locations in a VR world.
For example, you could set up a navigation grid with markers every
100 meters along an X-Y plane. Or maybe you'd like to put "crosshairs"
marking special locations.
The markers this program makes resemble 3D "plus" signs.
Just give this program a list of X Y Z coordinates where you want "plusses"
and optionally the length you want for the "plus" lines.
Also, some viewers may not support the concept of a "point", and if you try
to fake it with a "line" of zero length, they may optimize it out.
(VRML 1 and VRML 2 both support a Point Set but other formats may not.)
So if you want to plot a "dot" and have it visible, use this program
to plot a small "plus" instead.
Use the size argument to set the length of the short lines
to some value appropriate to the overall dimensions of your world
and your typical viewing distance.
Another way of marking a special spot in your world might be to plot a
triangle or some other shape there. However there is always the chance
you'd be viewing its plane end-on. So you'd need several intersecting
triangles. Ultimately nothing is less work to draw and render than 3
straight lines.
One problem can arise if you make your plus signs in rectangular space
and then use drawball.pl to convert to spherical space.
By definition, X and Y are in degrees while Z is in radius units which
may or may not be anywhere near the same size as a degree.
For example, on Earth, a degree may be about 111 km, but the exact
figure varies depending on where you are.
The result is a 3D plus sign with it's Z dimension distorted.
As a kludge (I haven't tried this myself yet) you might be able to
make your xyz file into a draw file as point:x y z, run that thru
drawball.pl to turn spherical coordinates into cartesian,
then extract the cartesian x y z to feed into this program,
effectively creating the plus signs in spherical space.
Unfortunately, if the plus signs are generated after drawball.pl
they'd be oriented to the viewer's X Y Z
perspective rather than your world's curved X Y Z perspective.
ENH The fix to this whole issue is probably to accept 3 length
parameters, x y and z. Then you could ask for a plus that is
one degree by one degree by 111 km.
This will read data in X Y Z ASCII format and output line instructions
that drawiv.pl can turn into a VRML 1.0 world
or drawwrl.pl can turn into a VRML 2.0 world.
The input points will become the centers of small "plus" symbols
consisting of 3 lines that intersect along the X, Y and Z axes.
Input format examples:
-34.29 19.24 5.96
-33.66 21.33 5.38
-32.85 19.62 0.57
-31.97 20.22 6.20
Color and linewidth should be set elsewhere, for example:
echo "color=0.9 0.3 0.9;linewidth=1" > myplus.draw
plusdraw.pl < myplus.xyz >> myplus.draw
drawiv.pl < myplus.draw > myplus.iv
| Written by |
Marvin Simkin |
| Filename |
plusdraw.html |
| Last updated |
April 5, 2005 |
|
|
|