Hi,
I started with the ExPlane file katopz pointed me to. Initially I
worked on a macbook.
When I moved the files to an iMac the file looked different.
Here is the simple code:
package
{
import __AS3__.vec.Vector;
import away3dlite.materials.*;
import away3dlite.primitives.*;
import away3dlite.templates.*;
import flash.display.Bitmap;
import flash.display.BlendMode;
[SWF
(backgroundColor="#000000",frameRate="30",quality="MEDIUM",width="800",height="600")]
/**
* Plane test
*/
public class ExPlane extends BasicTemplate
{
[Embed(source="people_in_room2.jpg")]
private var Texture:Class;
private var plane:Plane;
private var textureBitmap:Bitmap;
/**
* @inheritDoc
*/
override protected function onInit():void
{
camera.z = -900;
textureBitmap = Bitmap(new Texture());
view.addChild(textureBitmap);
textureBitmap.x = -textureBitmap.width/2;
textureBitmap.y = -textureBitmap.height/2;
textureBitmap.z = 0.00000001;
//textureBitmap.alpha = .01;
textureBitmap.blendMode = BlendMode.DIFFERENCE;
var segments:uint = 1;
var planeMaterial:BitmapMaterial = new BitmapMaterial
(textureBitmap.bitmapData.clone());
planeMaterial.smooth = true;
plane = new Plane(planeMaterial, textureBitmap.width,
textureBitmap.height, segments, segments);
plane.bothsides = true;
plane.rotationX = 90;
scene.addChild(plane);
}
/**
* @inheritDoc
*/
override protected function onPreRender():void
{
plane.rotationY = -(stage.stageWidth - mouseX) * .51;
}
}
}
It displays the plane pretty tiny. I had to make the plane 20 times
larger on the iMac to get the same result as on the macbook:
plane = new Plane(planeMaterial, textureBitmap.width*20,
textureBitmap.height*20, segments, segments);
I can't think of any reason why I should change my code when I change
if from one machine to another, both having the same os. Why are these
sizes affected by the user's resolution ? Is there a fix for this ?
Thanks,
George