Even if you had a chance to look at Getting started using BasicView.as this tutorial provides another example of basic texturing in Papervision.
In Papervision for the most part you have objects (planes, cubes, cones, 3D Models, etc) and then you have the textures or materials that you add to these objects. Think of it as getting a brand new iPhone and then buying a case or skin for that iPhone. We are essentially doing the same thing in principle - we have our object a cone (iPhone) and a material a bitmapMaterial (iPhone skin).
-
package
-
{
-
import flash.events.Event;
-
import org.papervision3d.view.BasicView;
-
import org.papervision3d.objects.primitives.Cone;
-
import org.papervision3d.materials.BitmapFileMaterial;
-
-
public class Main extends BasicView
-
{
-
protected var cone:Cone
-
protected var bitmapMaterial:BitmapFileMaterial;
-
-
public function Main()
-
{
-
super();
-
createChildren();
-
startRendering();
-
}
-
public function createChildren():void
-
{
-
//Create a new 3D object
-
bitmapMaterial = new BitmapFileMaterial("images/ourtex.jpg")
-
cone = new Cone(bitmapMaterial, 20, 200);
-
-
//Set some properties
-
cone.scale = 4;
-
cone.pitch( -10);
-
-
//Add to scene
-
scene.addChild(cone);
-
}
-
-
override protected function onRenderTick(event:Event = null):void
-
{
-
super.onRenderTick(event);
-
-
//Rotate
-
cone.yaw(3);
-
}
-
}
-
}
As you can see from the code above we have a cone and a bitmap texture.



Hi there,
Thank you so much for these tutorials!
Very helpful!
It saved me a lot of time!
Cheers!
Ninja Girl
Is there a way I can create a texture on the back of an image so that the “material” is an image on oneside and a texture on the back side?
I really like your tutorials :)
I ha ve a question. How to make a swf file as material?
Which editor are you using? I can get your sources to work but if I replace the dae files with mine they don’t work. I use Google Sketchup/Blender 2.49b Collada 1.4.0