Sky, Newbie Posted: 06 February 2012 06:49 AM Total Posts: 16
Hi, it’s been few weeks trying out AWAY3D but I’m feeling myself still new with it.
This time I tried to load a 12 stories building. (not very complicate)
I have “parsing failure” while import my OBJ model.
var Obj:Loader3D = new Loader3D();
Obj.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);
Obj.load(new URLRequest(‘module/22.obj’),new OBJParser(0.001));
protected function onResourceComplete(e:LoaderEvent):void
{
scene.addChild(Loader3D(e.target));
}
I checked the model in 3dMax it’s just fine and done by pro, and it probably can’t be simplier. Is there anyway to solve this? thx for helps.
Stephen Hopkins, Sr. Member Posted: 06 February 2012 10:01 AM Total Posts: 110
[ # 1 ]
Did you try adding the loader3D obj, or its children (since its an objectcontainer3d), instead of the e.target?
When I use loader3D, the loader3D class ends up holding the model
TrueSign, Member Posted: 06 February 2012 11:30 AM Total Posts: 57
[ # 2 ]
You can use:
[Embed(source="my.obj", mimeType="application/octet-stream")] private var MyModel: Class;
private function onAssetComplete(event:AssetEvent):void { if (event.asset.assetType == AssetType.MESH) { if (event.asset.assetNamespace == "MyName") { var _model:Mesh = event.asset as Mesh; _view.scene.addChild(_model); }}}
Sky, Newbie Posted: 07 February 2012 03:22 AM Total Posts: 16
[ # 3 ]
thx, I tried and it didnt work.
I actually tried addChild, but the problem is “parsering error” pops when loading the model.
Stephen Hopkins - 06 February 2012 10:01 AM
Did you try adding the loader3D obj, or its children (since its an objectcontainer3d), instead of the e.target?
When I use loader3D, the loader3D class ends up holding the model
Sky, Newbie Posted: 07 February 2012 03:24 AM Total Posts: 16
[ # 4 ]
I am using ver.4.0. and it doesn’t take the codes. Is these code for earlier version?
TrueSign - 06 February 2012 11:30 AM
You can use:
[Embed(source="my.obj", mimeType="application/octet-stream")] private var MyModel: Class;
private function onAssetComplete(event:AssetEvent):void { if (event.asset.assetType == AssetType.MESH) { if (event.asset.assetNamespace == "MyName") { var _model:Mesh = event.asset as Mesh; _view.scene.addChild(_model); }}}
maddog, Sr. Member Posted: 07 February 2012 03:59 AM Total Posts: 118
[ # 5 ]
With loading 3ds files I would get parsing errors.
1. When I assigned a texture improperly in 3d editor. It seems more stable to add textures after model loaded in away3d for me at least.
2. When there was non-manifold vertices.
3. When there was duplicate vertices.
not sure if this applies to loading object files as well.
TrueSign, Member Posted: 07 February 2012 09:43 AM Total Posts: 57
[ # 6 ]
Sky: This is a code for the newest version of away3d v4 DEV branch.
Sky, Newbie Posted: 08 February 2012 10:16 AM Total Posts: 16
[ # 7 ]
thx. I’ve checked #1 and #2 from the list with no luck. About #3, maybe I don’t understad, but is it possible no duplicate vertices at one scene?
maddog - 07 February 2012 03:59 AM
With loading 3ds files I would get parsing errors.
1. When I assigned a texture improperly in 3d editor. It seems more stable to add textures after model loaded in away3d for me at least.
2. When there was non-manifold vertices.
3. When there was duplicate vertices.
not sure if this applies to loading object files as well.
Sky, Newbie Posted: 08 February 2012 10:18 AM Total Posts: 16
[ # 8 ]
I am not sure what DEV branch means. I am using the latest away3D engine downloaded from this site.
TrueSign - 07 February 2012 09:43 AM
Sky: This is a code for the newest version of away3d v4 DEV branch.
Fabrice Closier, Administrator Posted: 08 February 2012 01:39 PM Total Posts: 1265
[ # 9 ]
from http://github.com/away3d/away3d-core-fp11 you c,an choose to use either master or dev (there is a dropdown menu to select the one you want). On Git site, you can download the zip after you have selected the branch. The dev branche is more or less what “master” will become later on. Using a Git client, switch branch and set to dev. Once you pull (most clients do it automatically on switch), the source on your disc will represent the same as the dev branch on site.
Using this branch may require more work for you, as we do change or break stuff with no warnings. That’s why we recommand using ‘dev’ only for test/learning purposes.
If you are not sure, and want id the diff between the two versions. Look in src package. I you see a ‘textures’ package you have ‘dev’, if this package is not there, you probably run ‘master’.
Sky, Newbie Posted: 09 February 2012 04:31 PM Total Posts: 16
[ # 10 ]
thanks so much for the helps.
I just happen to find out the problem is the texture. I am using Vray as 3D render engine and maps. AWAY3D does not recognize texture path of Vray. Now I use standard texture in 3D max, and the model works in AWAY3D.
The new challenge is to bake the model in Vray, and then use the baked maps as standard texture. So far the 3D max isn’t working fine. But finally after many helps from this forum, I have some improvement. Thanks!