Hi,
I’m trying to start with away3d, my objective is to add simple 3D objects and animations to my projects, like spheres, boxes, planes, skyboxes, text and some simple models, but I’m having a lot of trouble getting started, I tried to create something with flash CS4 IDE but I got no results, so I got flash builder but now I can’t even get a simple plane going. Here’s my code so far:
package
{
import away3d.containers.View3D;
import away3d.entities.Mesh;
import away3d.materials.ColorMaterial;
import away3d.primitives.PlaneGeometry;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Vector3D;
[SWF(width = 640, height=480, frameRate=60)]
public class Main extends Sprite
{
private var view:View3D;
private var plane:Mesh;
private var Event:Object;
public function Main()
{
setupScene();
}
private function setupScene():void
{
view = new View3D();
addChild(view);
plane = new Mesh(new PlaneGeometry(),new ColorMaterial(0xFF0000));
view.scene.addChild(plane);
view.camera.z = -500;
view.camera.y = 300;
view.camera.lookAt(new Vector3D());
addEventListener(Event.ENTER_FRAME, loop);
}
protected function loop(event:Event):void
{
view.render();
}
}
}
And I’m getting the following error
1046: Type was not found or was not a compile-time constant: Event. Main.as /cubo 3d/src line 39 Flex Problem
Anyway I would thank any help regarding this issue and also any answer to the following question:
Considering what my intentions are(like I said, adding simple 3D stuff to web apps, projectors, etc.) is Away3D the stuff for me or I’m over my head here and should aim to something more simple?, i tried with swift 3d but the rendering quality/file size relation is not very good and also there’s no possible way to interact with the created elements so I looked around and read that everyone recommended Away3D.
Thank You,
Rodrigo.