[Papervision3D] my test can't work on the website
tiho10 at 126.com
tiho10 at 126.com
Sat Dec 1 19:19:02 PST 2007
Hi,everybody.I'm a new guy in pv3d.
I have a problem!!!!!!My test on the localhost it's ok,but when i put them to the website"www.oukailai.com/testwork/firesphere.swf",nothing appear.
here is the code:
public function FireSphere()
{
//this.configureTexture();
this.configureScene();
this.configureListeners();
}
// Initialization
/**
* Create the necessary pieces to render the fire texture
*/
/**
* Configures the PV3D scene and associated objects
*/
private function configureScene(): void
{
this.camera = new FreeCamera3D();
this.camera.z = -650;
this.sceneContainer = new Sprite();
this.sceneContainer.x = this.stage.stageWidth / 2;
this.sceneContainer.y = this.stage.stageHeight / 2;
this.addChild(this.sceneContainer);
var material = new BitmapFileMaterial("fire.png");
var materialsList: MaterialsList = new MaterialsList();
materialsList.addMaterial(material, "Fire");
this.sphere = new Collada("Sphere.dae", materialsList);
this.scene = new Scene3D(sceneContainer);
this.xRotContainer = new DisplayObject3D();
this.xRotContainer.addChild(this.sphere);
this.scene.addChild(this.xRotContainer);
}
/**
* Configures the necessary listeners
*/
private function configureListeners(): void
{
this.addEventListener(Event.ENTER_FRAME, this.handleEnterFrame);
this.stage.addEventListener(Event.RESIZE, this.handleResize);
}
// Event Handlers
/**
* Handles the enter frame event
*/
private function handleEnterFrame(event: Event): void
{
// Update material
// Render
this.scene.renderCamera(this.camera);
}
/**
* Handles the resize event from the stage and
* repositions the scene container.
*/
private function handleResize(event: Event): void
{
this.sceneContainer.x = this.stage.stageWidth / 2;
this.sceneContainer.y = this.stage.stageHeight / 2;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20071202/c92d4c68/attachment.html
More information about the Papervision3D
mailing list