I’m working on a project where I need to display a complex 3D model (around 16000 polygons). I used the 3ds file loader, because that seemed the easiest route to load a model made in 3D studio max.
I soon had a proof of concept running. However, then I heard from my client he was getting some errors: Cannot create property transparent on flash.display.Stage3D to be more precise.
I read somewhere that this was because of a change in the new flash player version, and that it was fixed. So I downloaded a more recent version of away3d from github… recompiled… and nothing happended… nothing on screen. Looks like 3Ds file loading was broken in that version. So I tried 3-4 other recent versions. No succes.
I urgently need a stable version of away3d 4, with working 3Ds file loading. Can anyone tell me what version I should download?
3ds file loading (urgent)Software: Away3D 4.x |
||
mole, Newbie
Posted: 23 February 2012 12:12 PM Total Posts: 29 |
||
theMightyAtom, Sr. Member
Posted: 23 February 2012 01:21 PM Total Posts: 669 [ # 1 ] Here’s a link to a zip of the last stable version I was using before the recent Beta release. There are a lot of changes in the Beta, which is what you now get when you update from the main branch on github. If you’re really desperate, you are welcome to send it to me ( ps at videometry dot net) and if there’s a quick fix, I’ll do it :0) Good Luck! |
||
mole, Newbie
Posted: 26 February 2012 03:37 PM Total Posts: 29 [ # 2 ] That version doesn’t give me compile errors, but my code no longer works, and I don’t have a clue what I’m doing wrong! What I’m doing is this: Parsers.enableAllBundled(); Then in the asset complete handler, I check if the asset is the mesh, if so, I assign a new material. Even if I don’t do this, nothing appears on screen, so this isn’t the problem. In the resource complete handler, I add the model loader to the stage. |
||
mole, Newbie
Posted: 26 February 2012 03:38 PM Total Posts: 29 [ # 3 ] Euhm.. i mean I add it to the scene:
private function resourceCompleteHandler(evt:LoaderEvent):void{ |
||
theMightyAtom, Sr. Member
Posted: 26 February 2012 08:57 PM Total Posts: 669 [ # 4 ] The only difference I see compared to how I do it, is that I don’t use ASSET_COMPLETE, and add materials on LoaderEvent.RESOURCE_COMPLETE. If you don’t assign a material in resourceCompleteHandler, that can be why you’re not seeing anything. I gave up early on with the AssetLoader, never could figure it out.
public function loadModel(model:String):void { |
||
Alex Bogartz, Sr. Member
Posted: 26 February 2012 10:45 PM Total Posts: 216 [ # 5 ] In my own workflow, if you assign a bitmap texture in your 3D program and make sure it has unwrapped UVs, you don’t need to assign the materials at all in code, but you do need to embed the textures and map the bitmapData to the material name in the 3DS files. My tactic usually involves loading the file using AssetLoader, then mapping the textures one at a time when the parser hits an error. Once it’s all done you will see your whole scene with all textures applied. |
||
mole, Newbie
Posted: 26 February 2012 10:59 PM Total Posts: 29 [ # 6 ] Something must have changed to the camera between the version I was using, and the version you linked to.
if (_drag) updateRotationTarget(); if I don’t do a lookAt(), it seems like the camera is still orbiting the model fine. However, I noticed my model is mirrored. That’s no good, but I can look into that later. |
||
Alex Bogartz, Sr. Member
Posted: 26 February 2012 11:17 PM Total Posts: 216 [ # 7 ] You model may not be centered in the 3D world. So even though it says it’s at 0,0,0, it may in face be somewhere else. Open it up in Blender and make sure it’s centered. If it’s not, center it, apply the transforms, then export as 3DS again. |
||
|
||
Alex Bogartz, Sr. Member
Posted: 27 February 2012 03:42 PM Total Posts: 216 [ # 9 ] One thing to remember is that even though the mesh is in the center of the scene, the geometry…the vertices and faces…may be offset. The only way to know for sure is to open the 3DS in a program like Blender, center it on the grid, then re-export. |
||
mole, Newbie
Posted: 27 February 2012 04:45 PM Total Posts: 29 [ # 10 ] Like I said, that’s not what’s happening. I Tested it by adding a sphere at 0,0,0. That way I can visually see the scene center. And my model is located there. |