Im using papervision3D to try and import a 3d object from Google Sketchup to flash but i’m getting a few errors in my code and i don’t know why. Could you guys give me any suggestions to why i’m getting these errors?
I have highlighted the text in red in the code where its bringing up the error messages. Someone please help me out, i’ve been trying to solve this for the last 2days now. Thanks
heres the error messages;
Pultizer3d.as Line 39 – 1067: Implicit coercion of a value of type org.papervision3d.objects:DisplayObject3D to an unrelated type Number.
Pultizer3d.as Line 58 – 1136: Incorrect number of arguments. Expected 0.
Pultizer3d.as Line 64 – 1137: Incorrect number of arguments. Expected no more than 3.
heres the code;
package {
import com.toky.BtnCamera;
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.parsers.DAE;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
public class Pulitzer3d extends Sprite
{
public var viewport:Viewport3D;
public var renderer:BasicRenderEngine;
public var scene:Scene3D;
public var camera:Camera3D;
public var dae:DAE;
public var cm:ColorMaterial;
public var holder:DisplayObject3D;
public var cameraBtn:BtnCamera;
public function Pulitzer3d() {
init();
}
private function init() {
//basic scene stuff
viewport = new Viewport3D(900, 650, true,false);
addChild(viewport);
renderer = new BasicRenderEngine();
scene = new Scene3D();
[COLOR=Red] camera = new Camera3D(holder, 15, 100);[/COLOR]
camera.z = -50;
//COLOR MATERIAL
cm = new ColorMaterial(0xcccccc, .85, true);
//DAE
dae = new DAE();
dae.load("pulitzer.dae", new MaterialsList({all:cm}));
holder = new DisplayObject3D();
holder.addChild(dae);
holder.rotationX = 90;
holder.rotationY = 45;
scene.addChild(holder);
stage.addEventListener(Event.ENTER_FRAME, renderStuff);
//SETUP BUTTON
[COLOR=Red] cameraBtn = new BtnCamera(camera);[/COLOR]
addChild(cameraBtn);
}
private function renderStuff(e:Event) {
[COLOR=Red]renderer.renderScene(scene,camera,viewport,true);[/COLOR]
}
}
}