The Papervisions class BasicView.as makes it very easy to get a 3D model on a stage. In BasicView you have camera, viewport and BasicRenderer definded, just check if you want to change the default settings.

I recommand a look in the Class itself: org.papervision3d.view.BasicView!

Extend the class:

public class MyFirstDae extends BasicView

Initiate a dae modell:

var allDae:DAE = new DAE();

Load the dae:

allDae.load("assets/modells/01/01.dae");

I recommend a Loader Listener to be sure everything is loaded before i try to get the modell on the scene.

dae.addEventListener(FileLoadEvent.LOAD_COMPLETE, om_handleLoadComplete);

Then add to scene:

scene.addChild(allDae);

At least not forget to start rendering:

startRendering();

If nothing seems to be on the stage, then it may be the camere (camera.zoom). I remember being inside my first model and it took a while till i realized: The model is on the stage/scene – and just needed to zoom out with the camera.

Another mistake happens with the texture, cause this can be allocated to the model in the 3D Programm. In this case its important to check if this is in the same directory. In the model itself its defined ind the library_images:

< library_images>
   < image id="cow.png" name="cow_png">
     < init_from>./cow.png
   < /image>
 < /library_images>

If the pat isn't correct, or the bitmap is not in the right folder (in this case same as modell), one can see the nacked model poligones), but no texture.

Personaly i prefer to script the textures on the model, that way i can also change the Bitmaps, like i do in the Modell Configurator.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
Get Adobe Flash player