[Papervision3D] anyone know how to solve this?

Joachim Baur post at joachimbaur.de
Mon Feb 21 03:01:21 EST 2011


Hi,

you can't do "addChild(layerSphere);" - the PV3D-viewport is the right 
object to use:
addChild(viewport);

You add all other PV3D-objects to the scene in order to make them visible:
scene.addChild(layerSphere);

Joachim

> Mice,  i try to follow your method but i still continue to get the error
> message or that the sphere doesn't appeared when i run the program. Below is
> my coding , can you tell me what when wrong ?
>
> public function GestureSq()
>          {
>              rendering = new BasicRenderEngine
>              camera = new Camera3D;
>              scene = new Scene3D;
>              viewport = new Viewport3D(800,600);
>              sphere = new Sphere(null,100,100);
>              layerSphere = new Viewportlayer (viewport,sphere);
>
>              layerSphere.addChild(sphere);
>              addChild(layerSphere);
>              rendering.renderScene(scene,camera,viewport);
>
>              layerSphere.addEventListener(GestureEvent.GESTURE_ROTATE,
> gestureRotateHandler);
>              layerSphere.addEventListener(GestureEvent.GESTURE_SCALE,
> gestureScaleHandler);
>
>          }




More information about the Papervision3D mailing list