Here i'm going to show you how we can add a primitive data object cube on to flash canvas using flex and to load 6 different bitmap pictures on to different faces of the cube.
here what we need to know is there are standard names assigned by papervision libraries to a cube.There are:
front, back, right, left, top, bottom & all
'all' is the acronym that we can used to reference all the faces at once.
here is the total sample code:
import org.papervision3d.materials.BitmapFileMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.primitives.Cube;
var materialList:MaterialsList = new MaterialsList({
front:new BitmapFileMaterial("pictures/tiles/1.jpg"),
back:new BitmapFileMaterial("pictures/tiles/2.jpg"),
right:new BitmapFileMaterial("pictures/tiles/3.jpg"),
left:new BitmapFileMaterial("pictures/tiles/4.jpg"),
top:new BitmapFileMaterial("pictures/tiles/5.jpg"),
bottom:new BitmapFileMaterial("pictures/tiles/6.jpg")});
var box:Cube = new Cube(materialList);
scene.addChild(box);
What we do here is first we make a list of faces assigned with a name which is to replace by bitmap material/picture.
then we create the cube with material list. If there are the names we assigned are matched, then the materials are replaced.
Here is the sample output
Subscribe to:
Post Comments (Atom)
Beyond Toughness: Why Your Car's Brain Needs AEC-Q100 AND ASIL-B
AEC-Q100 vs. ASIL-B: Quality Meets Safety In the era of autonomous driving and electric vehicles, the electron...
-
This will create a certification file and send to free certification authority " https://certbot.eff.org " sponsored by linux foun...
-
Annual Technical Conference 2006 of IET-YMS Sri Lanka, 16 th October 2010 Department of Electrical and Information Engineering, University ...
-
Installing MPICH2 parallel computing from package manager or Ubuntu software center, will need lot configurations of available real processo...
No comments:
Post a Comment