I’ve recently converted my old model viewer to away3D (it was using papervision3D).
molehill model viewer
This is the version which automatically loads well-known papervision3d x-wing model:
molehill papervision3D X-Wing
This is the version automatically loads a face generated with 3Doodler ( :P ), looks nice with subsurface scatterin 3Doodler face
(if you don’t see anything, you probably should have installed Flash Player version 11+)
ModelViewer supports OBJ, 3DS, Collada, MD5, MD2, blah blah blah…
Since Away3D Broomstick is in alpha stage, my viewer is alpha too. It supports Collada objects (DAE and ZIP files) because I had to write DisplayObject3D – to – ObjectContainer3D converter: “PaperAway”
Usage:
var mesh:Mesh = PaperAway.fromDo3D( displayObject3D );
That’s all :P Well, there are some additional options, but I won’t describe them here, read the code yourself…
Some strange things I’ve noticed in molehill’s/away3d’s coordinate system – uv coords are assigned to vertex indices, not face indices. This forces you to do either of two things:
– make too many vertices, one vertex per face vertex
– check for vertex UV coords and create new vertex only if the uv coord of given vertex is unique. This is confusing explanation, you can check it in the source code for PaperAway.as , starting from line 242.
Class PaperAway is not fully featured, it does not create materials according to Papervision3D’s shadedMaterials. Also it does not transfer interactive events of displayObject3D.
These are the issues with Away3D which I’ve spotted so far (some descriptions are very sketchy, sorry):
-material.dispose() generates null exceptions
-model.clone is erroneous because SubMesh system is not fully implemented
-model.dispose() is kinda erroneous too
-submeshes materials does not resemble corresponding scenegraph meshes materials.
-parser of OBJ files – OBJParser – falls into infinite loop when supplied OBJ file has materials defined, by the material file does not exist. In errorMtl() function writing after the trace command “_mtlLib = false” solves the issue.
-there are some problems with updating textures. You can see them by clicking on wireframe and then on “normal” – texture’s not getting updated.
May 12th, 2011 at 4:38 am
Nice, I’m looking to migrate from papervision across to either Away3D or Alternativa3D, and one of the things I was working on was a collada viewer, which I got stuck on trying to combine the uvmap and shaders, so I though rather than bang my head against a rock trying to figure it out in papervision I might as well focus my efforts on getting it working using the gpu..
Any chance of source code?
May 12th, 2011 at 12:50 pm
Gave the source for “PaperAway.as”, the model viewer does not contain any sophisticated code ; p just loading the model using Papervision/Away3d importers and showing them on the screen
May 12th, 2011 at 7:26 pm
Okay, I’ll have a little look, thanks!
June 22nd, 2011 at 8:22 pm
Hey (sorry, couldnt find your name anywhere on the site),
I’m trying to use Broomstick currently as well and ran into two of the same issues.
1) I can’t clone a Mesh, seems only cloning primitives works right now
2) Cloned meshes don’t have interactive events (I wrote my own clone method which failed miserably so this could be part of the problem with this)
Have you come up with a solution yet for cloning a Mesh (or even an ObjectContainer3D)?
Also, good to see other Polish flash devs. I’m obviously Polish as well as you can probably tell by my last name :) Dzienkuje za twoja prace na tym blogu (my spelling is terrible).
October 2nd, 2011 at 3:58 pm
After 3 months, but I’m answering u : )
2) Interactive evts were pretty experimental in Away3D, didn’t test them cause I feared of running into infinite problems loop ; )
1) As far as I remember, cloning was broken in Away3D (don’t know how it is now), you must iterate every child and clone it, then gather children into an array and update the submeshes array. Iterating over children goes like this:
public static function iterateMesh( mesh:ObjectContainer3D , func:Function ):void{ = new Vector. ();
var child:ObjectContainer3D;
var i:int;
var stack:Vector.
stack.push( mesh );
while( stack.length ){
mesh = stack.shift();
if( mesh is Mesh ) func( mesh );
for( i = 0; i < mesh.numChildren; i++ ){ stack.push( mesh.getChildAt( i ) ); } } } I do something simmiliar in PaperAway.as, I go through Papervision's object scenegraph, gather children and then put them into new Away3D mesh. Then I fill the submeshes array with gathered children.
February 5th, 2012 at 2:23 pm
hi!!!