Re: [away3d] Away3d 4 : using AssetLibrary
Hey Rob Sorry but there are really things i do not understand while loading external assets. here is part of my script : private function loadObjects():void { //var context:AssetLoaderContext = new AssetLoaderContext(); var loader:Loader3D = new Loader3D(); loader.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete); loader.load(new URLRequest(assets/test/test.3ds),new Max3DSParser()); this.scene.addChild(loader); } private function onAssetComplete(event:AssetEvent):void { trace(on asset loaded +event.asset.name+ type=+event.asset.assetType); switch (event.asset.assetType) { case AssetType.MESH : trace(asset loaded mesh +event.asset.name); mesh = event.asset as Mesh; mesh.castsShadows = true; mesh.material = material; break case AssetType.BITMAP : var bmp:BitmapDataAsset = event.asset as BitmapDataAsset; trace(material info+bmp.name); material = new BitmapMaterial(); material.bitmapData = bmp.bitmapData; material.shadowMethod = new FilteredShadowMapMethod(this.light); material.lights = [this.light]; material.gloss = 30; material.specular = 1; material.ambientColor = 0x303040; material.ambient = 1; break; default: break; } } the problem is the following one : on my traces, i see the texture Uvmapped about my objet is well loaded, but the mesh itself doesn't. have also tried to do the same with assetLibrary.load(..) with the same result. If i request to load the jpg , it works, if i request to load the 3ds, it load the jpg I really understand nothing at all ... Does anyone has a simple sample about how to load an external mesh ? PS: just in case, the textures, material etc... has to have width/height to be an exposure of 2, and max 2048. This was not the case in away3D 3.6. Le 12/10/2011 22:56, Rob Bateman a écrit : Hey Fabrice there will be more demos in the away3d-examples-fp11 folder of this nature in the coming weeks. But to answer your question directly, yes there is. You can use the mapUrl() method of the AssetLoaderContext that is passed as an optional parameter in all load operations in Away3D if you are having trouble local/global filepaths, or you can set the includeDependencies property to false and manually handle the initialisation of materials by setting up an assetComplete event handler for all material assets encountered in the AssetLibrary parser. On Wed, Oct 12, 2011 at 8:58 PM, fabrice wolf fabrice.w...@gmail.com mailto:fabrice.w...@gmail.com wrote: Hi I am currently trying to upgrade my 3D map engine from 3.6 to 4.0. I used to use TextureQueue, but it seems we have to use AssetLibrary class now. My problem is that i can't embed the assets in my swf's, i need to load them then to build dynamically the objects. In 3.6, i was using 2 texturequeues feeded with xmls, one to load the texture, the other to load the normalmaps, and when i was sure everyhting was well laoded, i loaded the 3ds and build the objetcs and the meshes with good textures and normal maps. I have really look everywhere, but i have found no tutorial, niether explanation anywhere on how to load assets in 4.0. Anyone could help me ? Is there a solution to push urls of assets to load in the assetlibrary, then to load everthing at once ? any help would be fr welcome fabrice -- Rob Bateman Flash Development Consultancy rob.bate...@gmail.com mailto:rob.bate...@gmail.com www.infiniteturtles.co.uk http://www.infiniteturtles.co.uk www.away3d.com http://www.away3d.com -- Fabrice Wolf Ludoptin / Machiavelic SARL Tel : 04 84 25 25 78
Re: [away3d] Away3d 4 : using AssetLibrary
If you post your questions on Away3D.com forum you get more chances to get answered. On Sun, Oct 16, 2011 at 4:33 PM, fabrice wolf fabrice.w...@gmail.comwrote: Hey Rob Sorry but there are really things i do not understand while loading external assets. here is part of my script : private function loadObjects():void { //var context:AssetLoaderContext = new AssetLoaderContext(); var loader:Loader3D = new Loader3D(); loader.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete); loader.load(new URLRequest(assets/test/test.3ds),new Max3DSParser()); this.scene.addChild(loader); } private function onAssetComplete(event:AssetEvent):void { trace(on asset loaded +event.asset.name+ type=+event.asset.assetType); switch (event.asset.assetType) { case AssetType.MESH : trace(asset loaded mesh +event.asset.name); mesh = event.asset as Mesh; mesh.castsShadows = true; mesh.material = material; break case AssetType.BITMAP : var bmp:BitmapDataAsset = event.asset as BitmapDataAsset; trace(material info+bmp.name); material = new BitmapMaterial(); material.bitmapData = bmp.bitmapData; material.shadowMethod = new FilteredShadowMapMethod(this.light); material.lights = [this.light]; material.gloss = 30; material.specular = 1; material.ambientColor = 0x303040; material.ambient = 1; break; default: break; } } the problem is the following one : on my traces, i see the texture Uvmapped about my objet is well loaded, but the mesh itself doesn't. have also tried to do the same with assetLibrary.load(..) with the same result. If i request to load the jpg , it works, if i request to load the 3ds, it load the jpg I really understand nothing at all ... Does anyone has a simple sample about how to load an external mesh ? PS: just in case, the textures, material etc... has to have width/height to be an exposure of 2, and max 2048. This was not the case in away3D 3.6. Le 12/10/2011 22:56, Rob Bateman a écrit : Hey Fabrice there will be more demos in the away3d-examples-fp11 folder of this nature in the coming weeks. But to answer your question directly, yes there is. You can use the mapUrl() method of the AssetLoaderContext that is passed as an optional parameter in all load operations in Away3D if you are having trouble local/global filepaths, or you can set the includeDependencies property to false and manually handle the initialisation of materials by setting up an assetComplete event handler for all material assets encountered in the AssetLibrary parser. On Wed, Oct 12, 2011 at 8:58 PM, fabrice wolf fabrice.w...@gmail.comwrote: Hi I am currently trying to upgrade my 3D map engine from 3.6 to 4.0. I used to use TextureQueue, but it seems we have to use AssetLibrary class now. My problem is that i can't embed the assets in my swf's, i need to load them then to build dynamically the objects. In 3.6, i was using 2 texturequeues feeded with xmls, one to load the texture, the other to load the normalmaps, and when i was sure everyhting was well laoded, i loaded the 3ds and build the objetcs and the meshes with good textures and normal maps. I have really look everywhere, but i have found no tutorial, niether explanation anywhere on how to load assets in 4.0. Anyone could help me ? Is there a solution to push urls of assets to load in the assetlibrary, then to load everthing at once ? any help would be fr welcome fabrice -- Rob Bateman Flash Development Consultancy rob.bate...@gmail.com www.infiniteturtles.co.uk www.away3d.com -- Fabrice Wolf Ludoptin / Machiavelic SARL Tel : 04 84 25 25 78 -- Michael Ivanov ,Senior Programmer Neurotech Solutions Ltd. www.neurotechresearch.com http://blog.alladvanced.net Tel:054-4962254 mich...@neurotech.co.il t...@neurotech.co.il
Re: [away3d] Away3d 4 : using AssetLibrary
thnx i will try that Le 16/10/2011 16:38, Michael IV a écrit : If you post your questions on Away3D.com forum you get more chances to get answered. On Sun, Oct 16, 2011 at 4:33 PM, fabrice wolf fabrice.w...@gmail.com mailto:fabrice.w...@gmail.com wrote: Hey Rob Sorry but there are really things i do not understand while loading external assets. here is part of my script : private function loadObjects():void { //var context:AssetLoaderContext = new AssetLoaderContext(); var loader:Loader3D = new Loader3D(); loader.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete); loader.load(new URLRequest(assets/test/test.3ds),new Max3DSParser()); this.scene.addChild(loader); } private function onAssetComplete(event:AssetEvent):void { trace(on asset loaded +event.asset.name http://event.asset.name+ type=+event.asset.assetType); switch (event.asset.assetType) { case AssetType.MESH : trace(asset loaded mesh +event.asset.name http://event.asset.name); mesh = event.asset as Mesh; mesh.castsShadows = true; mesh.material = material; break case AssetType.BITMAP : var bmp:BitmapDataAsset = event.asset as BitmapDataAsset; trace(material info+bmp.name http://bmp.name); material = new BitmapMaterial(); material.bitmapData = bmp.bitmapData; material.shadowMethod = new FilteredShadowMapMethod(this.light); material.lights = [this.light]; material.gloss = 30; material.specular = 1; material.ambientColor = 0x303040; material.ambient = 1; break; default: break; } } the problem is the following one : on my traces, i see the texture Uvmapped about my objet is well loaded, but the mesh itself doesn't. have also tried to do the same with assetLibrary.load(..) with the same result. If i request to load the jpg , it works, if i request to load the 3ds, it load the jpg I really understand nothing at all ... Does anyone has a simple sample about how to load an external mesh ? PS: just in case, the textures, material etc... has to have width/height to be an exposure of 2, and max 2048. This was not the case in away3D 3.6. Le 12/10/2011 22:56, Rob Bateman a écrit : Hey Fabrice there will be more demos in the away3d-examples-fp11 folder of this nature in the coming weeks. But to answer your question directly, yes there is. You can use the mapUrl() method of the AssetLoaderContext that is passed as an optional parameter in all load operations in Away3D if you are having trouble local/global filepaths, or you can set the includeDependencies property to false and manually handle the initialisation of materials by setting up an assetComplete event handler for all material assets encountered in the AssetLibrary parser. On Wed, Oct 12, 2011 at 8:58 PM, fabrice wolf fabrice.w...@gmail.com mailto:fabrice.w...@gmail.com wrote: Hi I am currently trying to upgrade my 3D map engine from 3.6 to 4.0. I used to use TextureQueue, but it seems we have to use AssetLibrary class now. My problem is that i can't embed the assets in my swf's, i need to load them then to build dynamically the objects. In 3.6, i was using 2 texturequeues feeded with xmls, one to load the texture, the other to load the normalmaps, and when i was sure everyhting was well laoded, i loaded the 3ds and build the objetcs and the meshes with good textures and normal maps. I have really look everywhere, but i have found no tutorial, niether explanation anywhere on how to load assets in 4.0. Anyone could help me ? Is there a solution to push urls of assets to load in the assetlibrary, then to load everthing at once ? any help would be fr welcome fabrice -- Rob Bateman Flash Development Consultancy rob.bate...@gmail.com mailto:rob.bate...@gmail.com www.infiniteturtles.co.uk http://www.infiniteturtles.co.uk www.away3d.com http://www.away3d.com -- Fabrice Wolf Ludoptin / Machiavelic SARL Tel : 04 84 25 25 78 -- Michael Ivanov ,Senior Programmer Neurotech Solutions Ltd. www.neurotechresearch.com http://www.neurotechresearch.com http://blog.alladvanced.net Tel:054-4962254
Re: [away3d] Away3d 4 : using AssetLibrary
i did it. Just in case, as i am quite in a hurry with the project i have to produce, and that the projects , which was first supposed to be on 3.6 and now on FP11/away3D4, is there is any good pecilist looking for a mission to help me solved this problem : loading all the assets of a scene from external files (3ds and texture/normapMap) using away3d 4 fr fp11 ? better if french of course (i notices some of you ere french). if so contact me at fabrice.w...@ludoptin.fr thanx Le 16/10/2011 16:38, Michael IV a écrit : If you post your questions on Away3D.com forum you get more chances to get answered. On Sun, Oct 16, 2011 at 4:33 PM, fabrice wolf fabrice.w...@gmail.com mailto:fabrice.w...@gmail.com wrote: Hey Rob Sorry but there are really things i do not understand while loading external assets. here is part of my script : private function loadObjects():void { //var context:AssetLoaderContext = new AssetLoaderContext(); var loader:Loader3D = new Loader3D(); loader.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete); loader.load(new URLRequest(assets/test/test.3ds),new Max3DSParser()); this.scene.addChild(loader); } private function onAssetComplete(event:AssetEvent):void { trace(on asset loaded +event.asset.name http://event.asset.name+ type=+event.asset.assetType); switch (event.asset.assetType) { case AssetType.MESH : trace(asset loaded mesh +event.asset.name http://event.asset.name); mesh = event.asset as Mesh; mesh.castsShadows = true; mesh.material = material; break case AssetType.BITMAP : var bmp:BitmapDataAsset = event.asset as BitmapDataAsset; trace(material info+bmp.name http://bmp.name); material = new BitmapMaterial(); material.bitmapData = bmp.bitmapData; material.shadowMethod = new FilteredShadowMapMethod(this.light); material.lights = [this.light]; material.gloss = 30; material.specular = 1; material.ambientColor = 0x303040; material.ambient = 1; break; default: break; } } the problem is the following one : on my traces, i see the texture Uvmapped about my objet is well loaded, but the mesh itself doesn't. have also tried to do the same with assetLibrary.load(..) with the same result. If i request to load the jpg , it works, if i request to load the 3ds, it load the jpg I really understand nothing at all ... Does anyone has a simple sample about how to load an external mesh ? PS: just in case, the textures, material etc... has to have width/height to be an exposure of 2, and max 2048. This was not the case in away3D 3.6. Le 12/10/2011 22:56, Rob Bateman a écrit : Hey Fabrice there will be more demos in the away3d-examples-fp11 folder of this nature in the coming weeks. But to answer your question directly, yes there is. You can use the mapUrl() method of the AssetLoaderContext that is passed as an optional parameter in all load operations in Away3D if you are having trouble local/global filepaths, or you can set the includeDependencies property to false and manually handle the initialisation of materials by setting up an assetComplete event handler for all material assets encountered in the AssetLibrary parser. On Wed, Oct 12, 2011 at 8:58 PM, fabrice wolf fabrice.w...@gmail.com mailto:fabrice.w...@gmail.com wrote: Hi I am currently trying to upgrade my 3D map engine from 3.6 to 4.0. I used to use TextureQueue, but it seems we have to use AssetLibrary class now. My problem is that i can't embed the assets in my swf's, i need to load them then to build dynamically the objects. In 3.6, i was using 2 texturequeues feeded with xmls, one to load the texture, the other to load the normalmaps, and when i was sure everyhting was well laoded, i loaded the 3ds and build the objetcs and the meshes with good textures and normal maps. I have really look everywhere, but i have found no tutorial, niether explanation anywhere on how to load assets in 4.0. Anyone could help me ? Is there a solution to push urls of assets to load in the assetlibrary, then to load everthing at once ? any help would be fr welcome fabrice -- Rob
Re: [away3d] Away3d 4 : using AssetLibrary
Hey Rob and thank you i will try that, and if it works, i will put the code here in case it could help someone else :) thx Le 12/10/2011 22:56, Rob Bateman a écrit : Hey Fabrice there will be more demos in the away3d-examples-fp11 folder of this nature in the coming weeks. But to answer your question directly, yes there is. You can use the mapUrl() method of the AssetLoaderContext that is passed as an optional parameter in all load operations in Away3D if you are having trouble local/global filepaths, or you can set the includeDependencies property to false and manually handle the initialisation of materials by setting up an assetComplete event handler for all material assets encountered in the AssetLibrary parser. On Wed, Oct 12, 2011 at 8:58 PM, fabrice wolf fabrice.w...@gmail.com mailto:fabrice.w...@gmail.com wrote: Hi I am currently trying to upgrade my 3D map engine from 3.6 to 4.0. I used to use TextureQueue, but it seems we have to use AssetLibrary class now. My problem is that i can't embed the assets in my swf's, i need to load them then to build dynamically the objects. In 3.6, i was using 2 texturequeues feeded with xmls, one to load the texture, the other to load the normalmaps, and when i was sure everyhting was well laoded, i loaded the 3ds and build the objetcs and the meshes with good textures and normal maps. I have really look everywhere, but i have found no tutorial, niether explanation anywhere on how to load assets in 4.0. Anyone could help me ? Is there a solution to push urls of assets to load in the assetlibrary, then to load everthing at once ? any help would be fr welcome fabrice -- Rob Bateman Flash Development Consultancy rob.bate...@gmail.com mailto:rob.bate...@gmail.com www.infiniteturtles.co.uk http://www.infiniteturtles.co.uk www.away3d.com http://www.away3d.com -- Fabrice WOLF Machiavelic SàRL Tel 04 84 25 25 78 email : fabrice.w...@gmail.com
Re: [away3d] Away3d 4 : using AssetLibrary
Hey Fabrice there will be more demos in the away3d-examples-fp11 folder of this nature in the coming weeks. But to answer your question directly, yes there is. You can use the mapUrl() method of the AssetLoaderContext that is passed as an optional parameter in all load operations in Away3D if you are having trouble local/global filepaths, or you can set the includeDependencies property to false and manually handle the initialisation of materials by setting up an assetComplete event handler for all material assets encountered in the AssetLibrary parser. On Wed, Oct 12, 2011 at 8:58 PM, fabrice wolf fabrice.w...@gmail.comwrote: Hi I am currently trying to upgrade my 3D map engine from 3.6 to 4.0. I used to use TextureQueue, but it seems we have to use AssetLibrary class now. My problem is that i can't embed the assets in my swf's, i need to load them then to build dynamically the objects. In 3.6, i was using 2 texturequeues feeded with xmls, one to load the texture, the other to load the normalmaps, and when i was sure everyhting was well laoded, i loaded the 3ds and build the objetcs and the meshes with good textures and normal maps. I have really look everywhere, but i have found no tutorial, niether explanation anywhere on how to load assets in 4.0. Anyone could help me ? Is there a solution to push urls of assets to load in the assetlibrary, then to load everthing at once ? any help would be fr welcome fabrice -- Rob Bateman Flash Development Consultancy rob.bate...@gmail.com www.infiniteturtles.co.uk www.away3d.com