[Papervision3D] why can not see the 3d model?

Tyler Egeto tyleregeto at gmail.com
Thu Oct 16 09:28:26 PDT 2008


Hey there,

When creating your 3DS object rather than giving the constructor a materials
list object, just pass in a null value. The materials list object is useful
if you want to replace the existing textures saved on in the 3ds file with
ones you define at run time, so it will stop it from loading your external
images.

Additionally, try moving the position of your camera further back, you might
be too close to the object. And lastly, set the camera target equal to your
3d object, while this is not necessary, it will help to guarantee you are
actually looking at it in the scene.

Good luck!


sjkgxf7191 wrote:
> 
> I want to load a .3ds file into the flash.Why it can not show?
> This is my code here.Thanks.
> public class three_DS_insert extends Sprite
> 	{
> 		public var scene:Scene3D;
> 		public var camera:Camera3D;
> 		public var daeFile:DAE;
> 		public var _collada:Collada;
> 		public var pViewPort:Viewport3D;
> 		public var renderer:BasicRenderEngine;
> 		public var cm:ColorMaterial;
> 		public var _ase:Ase;
> 		public var _3ds:Max3DS;
> 		
> 		public function three_DS_insert()
> 		{
> 			build3D();
> 			buildObject();
> 		}
> 		
> 		private function build3D():void
> 		{
> 			pViewPort=new Viewport3D();
> 			addChild(pViewPort);
> 			
> 			scene=new Scene3D();
> 			camera=new Camera3D();
> 			camera.z=-4;
> 			
> 			renderer=new BasicRenderEngine();
> 		}
> 		
> 		private function buildObject():void
> 		{	
> 			var textureDir:String = "./images/";
> 			var materials:MaterialsList = new MaterialsList();
> 			
> 			_3ds.load("Tutuzi.3ds",materials,textureDir);
> 			
> 			scene.addChild(_3ds);
> 			
> 			this.addEventListener(Event.ENTER_FRAME,loop_rander);
> 		}
> 		
> 		private function loop_rander(e:Event):void
> 		{
> 			_3ds.rotationY+=2;
> 			renderer.renderScene(scene,camera,pViewPort);
> 		}
> 


-----
Tyler Egeto
http://tyleregeto.com TylerEgeto.com 
Have question? Email me at tyleregeto[at]gmail[dot]com
-- 
View this message in context: http://www.nabble.com/why-can-not-see-the-3d-model--tp20006348p20015934.html
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list