Hi.
I am trying to load in some geometry from a non-standard
file format into Java3D. I'm having trouble deciding how
to handle a certian type of geometry that appears
frequently in these files. Although an ingenious solution
to the problem, I these files use and "old" solution
for this problem, and I'm hoping there will be some other
method (or feature of Java3D) that I should use instead
to get the same functionality.
These files contain an instruction to create a line
that only shows up under certain conditions. These lines
are used mainly to connect the top and bottom "circles"
of a cylinder. These verticle lines are place all the way
around the cylinder, but only the two that approximate
the edges (for the current viewpoint) are supposed to be
drawn.
For example ont this cylinder only the vertical lines
from 9-0 and from 5-3 should be drawn. the lines from
8-7 and from 6-4 should be ignored until the cylinder
or view is rotated enough.
_____________
/1 2\
/ \
/ \
|\0 3/|
| \ / |
|9 \7___________4/ 5|
\ | | /
\ | | /
\|8_________6|/
So that it should look like this:
_____________
/1 2\
/ \
/ \
|\0 3/|
| \ / |
|9 \5___________4/ 5|
\ /
\ /
\8___________6/
The algorithm used by the file format, is to
specify 2 extra points for each line. The software
is supposed to only draw the line if both extra
points fall on the same side of the line when
projected on the image plate.
So to specify a line to sometimes be drawn between
points 0 and 9, the command would also specify points
1 and 5. As you can see from the drawing above,
from this view point both 1 and 5 fall to the right of
the line between 0 and 9 and therefore the line is
drawn. For the line between 5 and 8 the command would
also specify the points 0 and 4 and in the current
view 0 and 4 are on different sides of the line between
5 and 8 so the line is not drawn.
Is there a better way to have these edges only show
up when needed in Java3D? Is there a good way for me
to control wether or not J3D draws these lines based
on where the other 2 points fall on the image plate?
I was thinking that maybe I could subclass the line
geometry class... but I'm not sure what I should be
overriding...
Anyone got any ideas?
-Kyle
--
_
-------------------------------ooO( )Ooo-------------------------------
Kyle J. McDonald (o o) Systems Support Engineer
Sun Microsystems Inc. |||||
High End Server Engineering [EMAIL PROTECTED]
1 Network Drive BURL03-403 \\\// voice: (781) 442-2184
Burlington, MA 01803 (o o) fax: (781) 442-1646
-------------------------------ooO(_)Ooo-------------------------------
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".