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, then change the object with my object. but still not showing.
Im very confused, is that problem from how the object create? or need export again?
Please help me how to load 3ds/obj model :(
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(camera, null, 45, 10, 800);
view.addSourceURL("srcview/index.html");
addChild(view);
Signature = Sprite(new SignatureSwf());
SignatureBitmap = new Bitmap(new BitmapData(Signature.width, Signature.height, true, 0));
stage.quality = StageQuality.HIGH;
SignatureBitmap.bitmapData.draw(Signature);
stage.quality = StageQuality.LOW;
addChild(SignatureBitmap);
addChild(new AwayStats(view));
}