Dynamic 3d viewer?!

The situation is this;
I’d like to be able to use some raw 3d coordinates from a text file and display them, joined sequentially in a wireframe model. Then be able to rotate, scale etc the resulting model.

The coordinates aren’t from a 3d drawing package but rather measured - therefore each point is literally assigned three numbers, in a tab delimited file.

With a large number of points (i.e. over 100) is there a way to load in the file and then generate the resulting model?

I’d be really gratefule if anyone has any comments/ideas/solutions to this! :slight_smile:

This is an approach I would use, just some broad brushstrokes…

#1 I’d write a perl script to put those 3d coordinates into an XML file, so
I could use the XML features in actionscript to load 'em in.

#2 In action script, I’d load in the XML file, and parse it to a 2 dimensional
array. So you end up with something like

myModel = [[x1,y1,z1],
[x2,y2,z3],
etc… ]

I’d construct the XML so as to avoid having to do huge amounts of XML traversal. e.g., it’s easier to break up <coord xyz=“1,2,3”> via String.split() than to indvidually parse <coord x=1 y=2 z=3>

#3 The rendering pass would walk thru the array, and convert each x,y,z
triplet to a 2D x,y pair, using a basic 3d transform out of Foley Van ****. As
part of that transform, you would want a scaling variable and rotation variables, for whichever axes you intend to provide rotation on.

#4 I’d pay attention to the mouse dragging, using a mouse listener and use
that information to modify the rotation/scaling variables.

A model of only 100 pts or so certainly sounds doable. Get a copy of Foley Van ****, get a copy of Moock, and get cracking!

  • Jim

Thanks for the pointers! I’ll post some more details once I’m done!

muo