newbie issue

Software: Away3D 4.x

mstenger, Newbie
Posted: 25 May 2012 09:30 PM   Total Posts: 1

hi, i’m just getting started in away, and i am trying to make a cube and it won’t show up.  here is my related code.

private function createMap():void {
        mapMaterial = new ColorMaterial(0x888888);
mapMaterial.lightPicker = lightPicker;
var cgeom:CubeGeometry = new CubeGeometry();
map = new Mesh(cgeom, mapMaterial);
scene.addChild(map);
map.position = camera.position
map.z += 100
camera.lookAt(map.position);
}

mapMaterial, lightPicker, map, scene, and camera are all class variables.  it seems to be a pretty straightforward thing i’m trying to do here, but the screen just comes out black. no errors or anything

   

Avatar
TrueSign, Member
Posted: 27 May 2012 10:15 PM   Total Posts: 57   [ # 1 ]

Did you use view.render(); ? You need to set up 3dview and then call render. Do it in enterFrame function to refresh your screen every frame like:

this.addEventListener(Event.ENTER_FRAME, enterFrameFunct);
private function enterFrameFunct(ev : Event):void {
view.render();
}

   
   
‹‹ getting started mobile

X

Away3D Forum

Member Login

Username

Password

Remember_me



X