Hi Pete,
Thanks for your reaction!
I put view.render(); in the right place and deleted the first one.
Now I only have a black screen when running.
What do you mean by "view.render(); should be in a loop"?
Is there a code for that?
Jorn Westhof
Here is the mod code:
package
{
import away3d.cameras.*;
import away3d.containers.*;
import away3d.loaders.*;
import away3d.primitives.SeaTurtle;
import away3d.primitives.Sphere;
import away3d.events.*;
import away3d.loaders.data.*;
import away3d.core.base.*;
import flash.display.*;
import flash.events.*;
[SWF(backgroundColor="#000000")]
public class Basic01 extends Sprite
{
private var cam:TargetCamera3D;
private var view:View3D;
private var sphere:Sphere;
private var beest:SeaTurtle;
private var box:Object3DLoader;
public function Basic01()
{
// set camera
cam = new TargetCamera3D({zoom:5,focus:200});
// create a viewport
view = new View3D({camera:cam,x:200,y:200});
addChild(view);
// cam position
cam.z = -2000;
cam.x = -2000;
cam.y = -5000;
// create a sphere and put it on the 3D stage
sphere = new Sphere();
sphere.x = -500;
view.scene.addChild(sphere);
beest = new SeaTurtle();
beest.x = 500;
view.scene.addChild(beest);
// render the view
//view.render();
box = Max3DS.load("assets/jeep1.3DS",
{material:"green#blue",rotationX:-90});
box.addOnSuccess(onLoaderSuccess);
}
public function onLoaderSuccess(e:Event):void {
view.scene.addChild(box);
view.render();
}
}
}