Close Show/hide page

A Papervision 2.0 alpha example

Thumbnail - Click me

I drew up this example a few weeks ago to learn about the new features in Papervision 2.0 alpha. If you’re thinking of looking into the new version, then hopefully you’ll find the supplied source code below of some use. I used the code from this screencast on unitzeroone.com as a starting point.

The source code has example usage of the following things…

  • Setting up and rendering a simple 3d scene
  • Materials that take a light source, found in the org.papervision3d.materials.shadematerials package (GouraudMaterial, PhongMaterial, CellMaterial, FlatShadeMaterial, EnvMapMaterial). And CompositeMaterial, too, which is pretty useful as well.
  • Shaders (EnvMapShader)
  • Multiple viewports (used here to create the reflection on the floor)
  • Simple user interaction using InteractiveSceneManager (clicking on a ball makes it bounce)

I wanted to throw all the example materials into the scene at the same time in order to compare their appearance, etc., so you may find the demo to run quite slowly…

Source code

Licensed under a Creative Commons Attribution 3.0 License.

6 Responses to “A Papervision 2.0 alpha example”

  1. Ahmet Says:

    Demo is running smoothly :)
    Thanks for the source !

  2. xero / fontvir.us Says:

    very cool lee!
    thanx for posting the source!

    the only new feature i see missing is culling.
    you could zoom the cam and show a ploy count
    so ppl can see when an object is off screen pv3d
    dounst wait resources rendering unnecessary stuff…

    just a thought.
    thanx again!

  3. Boris Says:

    Hi Lee,
    cool Demo, but this line of code doesnt function

    // Make sphere bounce…
    Tweener.addTween(e.target, { y:100, bezier:{ y:600 }, time:3, transition:”easeoutbounce”} );

    There will be an error dropped that Sphere has no _bezier property - what is wrong

  4. Betty Says:

    I argued, Thornfield will, probably, be a good way from the town. satellite street map views A new servitude. There is something in that, I soliloquised

  5. hierro Says:

    Hello, what if i have a texturized plane and i wanna get the pixel color of a given 3d coordinates ? Just dunno enough about matrix and inverseMatrix, any hints ?

    thank u for help, hierro.

  6. nurah Says:

    thanks

Leave a Reply

Powered by WP Hashcash