Thanks to Luke I am the new proud owner of Papervision2.com. He is keeping busy and just ran out of time. I know he is sad to see it go, but glad that someone can take over and continue helping the Flash / Papervision community.
To introduce myself, I decided to take a tutorial from my site and add it to this new site.
The ole, doublesided plane. Lets get started.
Here are your options as we see it to create a double-sided plane.
Option 1:
Create two planes. Plane 1 with a z sorting of 1 and the other with 0 and the rotationY of one of those planes set to 180. You could then contain this in one display container.
Version 2:
Create one cube with a depth of 0. Then you just apply a material to the front and back. OK OK OK so this is not really a Plane... but I like this approach because it allows me to more easily use things like Bend Modifier.
If anyone has a better or more improved approach we would love to hear about it.
Here is what the code for Option 1:
-
package com.cs54.ui
-
{
-
import org.papervision3d.objects.primitives.Plane;
-
import org.papervision3d.materials.MovieMaterial;
-
import org.papervision3d.materials.utils.MaterialsList;
-
import org.papervision3d.objects.DisplayObject3D;
-
import com.everydayflash.pv3d.modifiers.Bend;
-
import flash.display.DisplayObject;public class Tree2Planes extends DisplayObject3D
-
{
-
[Embed(source="/assets/tree-side-1.png")]
-
public var TreeFront :Class;[Embed(source="/assets/tree-side-2.png")]
-
public var TreeBack :Class;
-
-
protected var treeFront :DisplayObject;
-
protected var treeBack :DisplayObject;
-
-
protected var treeFrontMat :MovieMaterial;
-
protected var treeBackMat :MovieMaterial;
-
-
protected var treeMatList :MaterialsList;
-
-
protected var _height :Number = 175;
-
protected var _width :Number = 191;
-
protected var _container :DisplayObject3D;
-
-
protected var plane1 :Plane;
-
protected var plane2 :Plane;
-
-
public function Tree2Planes():void
-
{
-
treeMatList = new MaterialsList();
-
treeFront = new TreeFront();
-
treeBack = new TreeBack();
-
-
//Tree Materials
-
treeFrontMat = new MovieMaterial(treeFront, true);
-
treeBackMat = new MovieMaterial(treeBack, true);
-
-
treeFrontMat.allowAutoResize = false;
-
-
plane1 = new Plane(treeFrontMat,_width,_height);
-
plane2 = new Plane(treeBackMat,_width,_height);
-
-
plane1.z = 1;
-
plane1.rotationY = 180;
-
-
_container = new DisplayObject3D();
-
-
addChild(_container);
-
_container.addChild(plane1);
-
_container.addChild(plane2);
-
-
}
-
-
public function get height():Number
-
{
-
return _height;
-
}
-
public function get width():Number
-
{
-
return _width;
-
}
-
-
}
-
-
}
Here is what the code for Option 2:
-
package com.cs54.ui
-
{
-
import org.papervision3d.materials.MovieMaterial;
-
import org.papervision3d.materials.utils.MaterialsList;
-
import org.papervision3d.objects.DisplayObject3D;
-
import org.papervision3d.objects.primitives.Cube;
-
import com.everydayflash.pv3d.modifiers.Bend;
-
import flash.display.DisplayObject;
-
-
public class Tree extends DisplayObject3D
-
{
-
[Embed(source="/assets/tree-side-1.png")]
-
public var TreeFront :Class;
-
-
[Embed(source="/assets/tree-side-2.png")]
-
public var TreeBack :Class;
-
-
protected var treeFront :DisplayObject;
-
protected var treeBack :DisplayObject;
-
-
protected var treeFrontMat :MovieMaterial;
-
protected var treeBackMat :MovieMaterial;
-
-
protected var treeMatList :MaterialsList;
-
-
protected var treeCube :Cube;
-
protected var _height :Number = 175;
-
protected var _width :Number = 191;
-
protected var _container :DisplayObject3D;
-
-
public function Tree():void
-
{
-
-
treeMatList = new MaterialsList();
-
treeFront = new TreeFront();
-
treeBack = new TreeBack();
-
-
//Tree Materials
-
treeFrontMat = new MovieMaterial(treeFront, true);
-
treeBackMat = new MovieMaterial(treeBack, true);
-
-
treeFrontMat.allowAutoResize = false;
-
-
treeFrontMat.animated = true;
-
-
treeMatList.addMaterial( treeFrontMat, "front" );
-
treeMatList.addMaterial( treeBackMat, "back" );
-
-
treeCube = new Cube(treeMatList, _width, 0, _height, 6, 6, 6);
-
-
var bend:Bend = new Bend(treeCube);
-
-
bend.quickBend(1, .1);
-
-
addChild(treeCube);
-
-
}
-
-
public function get height():Number
-
{
-
return _height;
-
}
-
public function get width():Number
-
{
-
return _width;
-
}
-
-
}
-
-
}
More to come in the weeks ahead. New papervision tutorials, full source, and support will all be provided.
Thanks for your continued support.
Charles Schulze,
CS54, LLC


