# Dynamic 3d viewer?!

**URL:** https://forum.kirupa.com/t/dynamic-3d-viewer/102174
**Category:** Uncategorized
**Created:** [February 20, 2004, 3:20pm UTC](https://forum.kirupa.com/t/dynamic-3d-viewer/102174 "2004-02-20T15:20:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![muoheous](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@muoheous](https://forum.kirupa.com/u/muoheous)
#### Post date: [February 20, 2004, 3:20pm UTC](https://forum.kirupa.com/t/dynamic-3d-viewer/102174/1 "2004-02-20T15:20:39Z")

</div>

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! 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2004, 6:37pm UTC](https://forum.kirupa.com/t/dynamic-3d-viewer/102174/2 "2004-02-20T18:37:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 10:19am UTC](https://forum.kirupa.com/t/dynamic-3d-viewer/102174/3 "2004-02-21T10:19:09Z")

</div>

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

muo
