Away3d Flash CS5: 1046: TextureBase not found

Software: Away3D 4.x

bauervision, Newbie
Posted: 22 November 2011 04:20 PM   Total Posts: 25   [ # 31 ]

thank you so much for your help. Sorry if I was a bit of a pain.

Now that I have the demo working, I am going to go through the away3d book, Essentials, and hopefully start to wrap my head around it all even more.

Thanks again!

Here’s a beer for ya!

 

   

Avatar
maddog, Sr. Member
Posted: 22 November 2011 04:36 PM   Total Posts: 118   [ # 32 ]

Here is a version that embeds 3ds file.
Had to do some google search to see how.

 

File Attachments
olderLoaderEmbed.zip  (File Size: 47KB - Downloads: 198)
   

bauervision, Newbie
Posted: 23 November 2011 04:37 PM   Total Posts: 25   [ # 33 ]

I’d hate to even ask, but if I wanted to toggle between 2 different models?

 

   

Avatar
maddog, Sr. Member
Posted: 23 November 2011 04:54 PM   Total Posts: 118   [ # 34 ]

you can load more then one model just duplicate everything to do with adding
first model and us addChild and removeChild to toggle between the two. You could also us alpha to hid one, but that may make things choppy. Note I have found that switching between models for extended period of time begins to eat up resources.

Or you just swap out the path to you 3ds file then call initObjects() with new path to second 3ds file since it has same name it should replace the other 3ds model. But I have not tested this.

 

   

bauervision, Newbie
Posted: 23 November 2011 04:56 PM   Total Posts: 25   [ # 35 ]

okay thanks!!!

 

   

Avatar
maddog, Sr. Member
Posted: 23 November 2011 05:15 PM   Total Posts: 118   [ # 36 ]

Hey I played around with it. The second method works but you have to give the model a name so you can remove and addChild. otherwise the old model stays up.

model.name "Model";//// this is done in onSuccess function

tog.addEventListener(MouseEvent.MOUSE_UPhm);
function 
hm(event:MouseEvent):void {
 
if(container.getChildByName("Model")){
  trace
("removed");
  
container.removeChild(container.getChildByName("Model"));
 
}
 
if(modPath == "assets/model.3ds"){
  modPath 
"assets/model2.3ds";
 
}else{
  modPath 
"assets/model.3ds";
 
}
 initObjects
();

 

   

bauervision, Newbie
Posted: 23 November 2011 05:51 PM   Total Posts: 25   [ # 37 ]

Sweet thanks!  I’ll check that out now.

BTW, I added the following to your code to add in a directional light. It adds the light, but holy crap does it chug! Any ideas?

function initDLight():void
 {
  directionalLight 
= new DirectionalLight3D({x:300y:300direction: new Vector3D(-1, -1,0)});
  
scene.addLight(directionalLight);
 
}
 
 
 
function initObjects():void {
 max3ds 
= new Max3DS();
 
max3ds.centerMeshes true;
 
initDLight();// <-------------------------------NEW
 
max3ds.material = new PhongBitmapMaterial(Cast.bitmap(texture),{alpha:1});
 
////
 
loader = new LoaderCube();
 
loader.loaderSize 200;
 
loader.addOnSuccess(onSuccess);
 
loader.loadGeometry("C:/.../model.3ds"max3ds);
 
/////
 
scene.addChild(loader);

 

   

Avatar
maddog, Sr. Member
Posted: 23 November 2011 06:10 PM   Total Posts: 118   [ # 38 ]

ya light in 3.x chug’s allot. I have not played much with lights because of that. So you may wanna ask someone with some experience with it. Lights do make the models look more realistic though. You could fake it though by baking on lighting on you textures. Prefab has good tools for that.

——————————————————————————————————-
whats your poly count. i tested on old loader and it seemed fine.

 

   

bauervision, Newbie
Posted: 23 November 2011 06:17 PM   Total Posts: 25   [ # 39 ]

okay thanks again!

 

   

bauervision, Newbie
Posted: 23 November 2011 06:29 PM   Total Posts: 25   [ # 40 ]

polycount is like 2K

——————————————————-

I wasn’t sure, thought maybe I was calling the create light function over and over or something….

You say it ran fine for you huh?

hmmmm….

 

   

Avatar
maddog, Sr. Member
Posted: 23 November 2011 06:38 PM   Total Posts: 118   [ # 41 ]

It may because the poly count for my little models is like 600. And my laptop is a overclocked core i7

———————————-
I might want to add it might be the PhongBitmapMaterial that is making it chug you might try a different material type.

 

   

bauervision, Newbie
Posted: 23 November 2011 06:45 PM   Total Posts: 25   [ # 42 ]

will do, all I want is the specularity. Eventually to use Normal maps…

I guess I can try the PhongColorMaterial….I really would like to keep my texture though.

———————————————————

yeah it helped some, but not worth taking the hit of losing the texture.

 

   

Avatar
maddog, Sr. Member
Posted: 23 November 2011 07:04 PM   Total Posts: 118   [ # 43 ]

hmmmm. Well I that is the nice thing about away 4x if you can get it to work.
You can save on cpu by moving view.render(); back to below arrangement.

if (move) {
  camera.panAngle = 0.3 * (stage.mouseX - lastMouseX) + lastPanAngle;
  camera.tiltAngle = 0.3 * (stage.mouseY - lastMouseY) + lastTiltAngle;
  camera.hover();
  view.render();
}

Movement will be smooth as long is mouse is done. This helps because cpu usage will be at zero ever time you go to mouse down instead of at 50 or higher.

 

   

Avatar
maddog, Sr. Member
Posted: 24 November 2011 04:36 PM   Total Posts: 118   [ # 44 ]

Here are some performance tweeks

http://www.packtpub.com/article/tips-and-tricks-on-away3d-3-6

 

   

bildakid, Newbie
Posted: 17 January 2012 05:48 PM   Total Posts: 4   [ # 45 ]

Ì`ve used the away 3d with flash cs4 and did a great kiosk for a museum of three models that a visitor could spinn around and zoom in and out.

I`ve tried to install the new away3d in flash professional CS5, but I just can`t seem to get it to work. I`ve tried to install the flash player 11 like in the link, but adobe says if you target flah player 10.2 they say it`s actually the flash player 11.

I just purchased adobe cs5 and then two weeks later I saw thier away3d demo is in flash builder (I can`t afford another 700.00 for another version of flash!!) I just wish there was a stratight forward tutorial to help with trouble shooting the new away3d into flash. It seems the hardedt part of away3d is just getting it installed. As I say I used the older version and it worked with just a few tweeks, please help me set up the new one I`d really love to use it`s new features but if I spend another day banging my head against the wall I`ll have to roll back to the previous version.

http://www.pakobrats.com/sstl/morrin.swf

Here is what I accokmplised in the old version I made the models in 3ds max and did the texturing in photoshop, you can zoom in and out by using the up and down arrow and if you click and dragg you rotate.

As you can see I`m not a noobie but just can`t seem to get the new version to work.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X