views:

163

answers:

1

I have a Collada (.dae) file that I found on Google's 3d Warehouse. Using Away3d, I'm able to load the file and display it on my view using the following code:

var object3d = Collada.parse(FooXML, { material:"white", x:0, y:0, z:0 });
view.scene.addChild(object3d);

The problem is that it's just floating out in space and no matter how I adjust the position via .x, .y, or .z, it never moves from its spot.

I'm using Flash cs4 and the latest stable release from Away3d.

A: 

are you re rendering the scene after translating the collada object?

how are you trying to translate the object? if you need to move it then you should set it in the init object eg: (FooXML, { material:"white", x:100, y:100, z:-70 }).

shortstick
Yes, I call render() and the Collada object appears with all my other objects. The problem is that the imported Collada object does not appear at (0,0,0) as I've designated in the Init, but off in space instead. Also, while I can change the position of all my other objects, I cannot change the position of the imported Collada object.
Jimtronic
ok, thats strange. instance a collada object and add a ´parseSuccess´ listener, then grab the information from that and see what the ´result´ is, and if it is the same as the object3D as you assigned it. http://www.away3d.com/livedocs/away3d/events/ParserEvent.html , http://www.away3d.com/livedocs/away3d/loaders/Collada.html
shortstick
Thanks, that led me to the problem. I think the scaling was mixing me up. The boundingRadius of the parsed object was 32k pixels and the visible object wasn't centered at 0, so on my stage, it appeared far off and my attempts to move it weren't perceptible at that scale.
Jimtronic