Kyle,
I'm not sure I understand. Are the traces to bounce off each other, or is it
just intersections with the walls of the box that are the problem?
The walls of the box should not be too hard to check - find the vector of
the trace over the last N points, check for intersection of the vector with
the 6 planes of the box, calculate the angle of reflection and apply as a
transformation to the trace.
Checking for intersections between all the other traces that have been laid
down is much harder and will probably be N2 or NlogN in the number of trace
vectors laid down. The trace points would have to be enclosed in a Box and
at each time-step check for intersections between the trace and the
generated Boxes. It's going to get very slow as the number of cylinders
increases, and there'll be lots of ugly geometry in calculating the angle of
reflection between the trace vector and the Boxes. Actually, it's very like
ray-tracing isn't it?
To bound the trace vector over N points you can:
Calculate the line passing through the N points (Sum of Squares) = V1
Calculate the maximum displacement in the 3 Cartesian directions normal to
V1
Generate a Box using the 3 displacement dimensions and the V1 vector
Good luck! Let me know how you get on.
Daniel Selman
Tornado Labs Ltd.
Email: [EMAIL PROTECTED]
Web: http://www.tornadolabs.com
Phone: +44 (0131) 343 2513
Fax: +44 07070 800 483
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Downey,
Kyle
Sent: 09 May 1999 18:19
To: 'java3d'
Cc: '[EMAIL PROTECTED]'
Subject: [java3d] bounding static paths in 3D-space?
We are working on an application that lets you draw traces using Java 2D,
then switch to a 3D view, where the Z axis is the time the trace was drawn
on the canvas. It's more complicated than that, but that's it in a nutshell
(thanks to folks on j2d and j3d for their help thus far!).
The problem is that right now we get a "canvas corridor"--just a small part
of the total universe is populated by traces, the X-Y rectangle of the
canvas by the time since you started drawing. What we'd like to do is bound
it. Specially, every time the canvas timeline extends past a certain
distance in Z, we'd like to have it change directions, so it seems like the
timelines are bouncing around inside a big box.
What we have: traces as segments of lines, with (x,y,z); currently being
converted into LineArray sets for rendering.
The question is: what's the best way to get a bounding box behavior? These
traces aren't moving, so collisions don't make sense (or do they?), but
that's kind of what we want: reflected rays randomly tracing around the
inside of a big box. I thought about generating a random rotation and
applying it as a Transform3D to the arms, but this doesn't give you a clean
bound.
Any ideas? We're under a tight deadline, and I'm out of good ones....
regards,
kd
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/