ywywdh / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

Scene 1, Layer 'Layer 1', Frame 1, Line 48 1061: Call to a possibly undefined method renderCamera through a reference with static type org.papervision3d.scenes:Scene3D. #278

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
this is my code

import org.papervision3d.scenes.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.materials.*;
import flash.display.Shape;
import flash.events.MouseEvent;
import flash.display.Graphics;
import flash.display.Sprite;
import flash.display.Scene;
import flash.media.Camera;
import flash.display.Bitmap;
import flash.events.Event;

var container:Sprite;
container = new Sprite();
container.x = stage.stageWidth * 0.5;
container.y = stage.stageHeight * 0.5;
addChild(container);

var scene:Scene3D = new Scene3D(container);
var camera:Camera3D = new Camera3D();
camera.zoom = 2;

var bam:BitmapAssetMaterial;
bam = new BitmapAssetMaterial("FlashIcon");
bam.oneSide = false;
bam.smooth = true;

for (var i:uint = 0; i < 50; i++)
{
    var p:Plane = new Plane(bam,300,300,2,2);
    scene.addChild(p);
    p.x = Math.random() * 1000 - 500;
    p.y = Math.random() * 1000 - 500;
    p.z = Math.random() * 1000 - 500;
    p.rotationZ = Math.random() * 360;
}

this.addEventListener(Event.ENTER_FRAME, Render);

function Render(e:Event):void
{
    camera.x += stage.mouseX - (stage.stageWidth * 0.5);
    camera.y += stage.mouseY - (stage.stageHeight * 0.5);
    scene.renderCamera(camera);
}

Original issue reported on code.google.com by vinayak...@gmail.com on 21 Jan 2011 at 4:18