Can’t load obj/3ds model

Software: Away3D 4.x

tebegane, Newbie
Posted: 28 October 2015 05:13 PM   Total Posts: 3

Im new in flash progamming ,im try download 3ds/obj model from web, then try to load them in flash, but that object not showing, i try use the away3d load3DS/loadOBJ example code, but still not showing. im very confused, is that problem from how the object create? or need export again?

public class Main extends Sprite
 {
  [Embed
(source="/../embeds/signature.swf"symbol="Signature")]
  
public var SignatureSwf:Class;

  
[Embed(source="/../embeds/30.obj"mimeType="application/octet-stream")]
  
private var HeadModel:Class;

  
[Embed(source="/../embeds/head_diffuse.jpg")]
  
private var Diffuse:Class;

  
[Embed(source="/../embeds/head_specular.jpg")]
  
private var Specular:Class;

  
[Embed(source="/../embeds/head_normals.jpg")]
  
private var Normal:Class;
  
  
//engine variables
  
private var scene:Scene3D;
  private var 
camera:Camera3D;
  private var 
view:View3D;
  private var 
cameraController:HoverController;

  private var 
Signature:Sprite;
  private var 
SignatureBitmap:Bitmap;

  private var 
headMaterial:TextureMaterial;
  private var 
subsurfaceMethod:SubsurfaceScatteringDiffuseMethod;
  private var 
fresnelMethod:FresnelSpecularMethod;
  private var 
diffuseMethod:BasicDiffuseMethod;
  private var 
specularMethod:BasicSpecularMethod;

  private var 
light:PointLight;
  private var 
direction:Vector3D;
  private var 
lightPicker:StaticLightPicker;
  private var 
headModel:Mesh;
  private var 
advancedMethod:Boolean true;

  private var 
move:Boolean false;
  private var 
lastPanAngle:Number;
  private var 
lastTiltAngle:Number;
  private var 
lastMouseX:Number;
  private var 
lastMouseY:Number;

  public function 
Main()
  
{
   init
();
  
}

  
private function init():void
  {
   initEngine
();
   
initLights();
   
initMaterials();
   
initObjects();
   
initListeners();
  
}

  
private function initEngine():void
  {
   stage
.scaleMode StageScaleMode.NO_SCALE;
   
stage.align StageAlign.TOP_LEFT;
   
   
scene = new Scene3D();
   
   
camera = new Camera3D();
   
   
view = new View3D();
   
view.antiAlias 4;
   
view.scene scene;
   
view.camera camera;

   
cameraController = new HoverController(cameranull4510800);
  
   
view.addSourceURL("srcview/index.html");
   
addChild(view);

   
Signature Sprite(new SignatureSwf());
   
SignatureBitmap = new Bitmap(new BitmapData(Signature.widthSignature.heighttrue0));
   
stage.quality StageQuality.HIGH;
   
SignatureBitmap.bitmapData.draw(Signature);
   
stage.quality StageQuality.LOW;
   
addChild(SignatureBitmap);
   
   
addChild(new AwayStats(view));
  

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X