hi all,
I have an orthographic camera that is positioned using
fov = 25;
minusZ = (Main.APP_HEIGHT * 0.5) / Math.tan((Math.PI / 180) * (fov * 0.5));
minusZHypotenuse = Math.sqrt((Main.APP_HEIGHT * Main.APP_HEIGHT) + (minusZ * minusZ));
Main.away3dView.camera.position = new Vector3D(0, Main.APP_HEIGHT, minusZHypotenuse);
Main.away3dView.camera.lookAt(new Vector3D(0,0,0));
(Main.away3dView.camera.lens as OrthographicLens).projectionHeight = Main.APP_HEIGHT;
then I create 16 planes that I want to position in a 4 x 4 grid with the following code
var tilt:Number = 2*512*Math.cos(360+Main.away3dView.camera.rotationX);
trace("tilt", tilt);
var rows:*=0;
var columns:*;
var increment:*=0;
while (rows < 4)
{
columns = 0;
while (columns < 4)
{
var bitmap:Bitmap = Main.currentMapImagesArray[increment] as Bitmap;
var bitmapData:BitmapData = bitmap.bitmapData;
var tile:Mesh = new Mesh(new PlaneGeometry(bitmap.width, -tilt), new TextureMaterial(new BitmapTexture(bitmapData)));
tile.x = columns * 1024;
tile.y = rows * tilt;
Main.mapTiles.addChild(tile);
++columns;
++increment;
}
++rows;
}
Then I rotate the grid, so that camera view is perpendicular on the grid
Main.mapTiles.rotati Vector3D(-Main.away3dView.camera.rotationX,-Main.away3dView.camera.rotationY,-Main.away3dView.camera.rotationZ);
but for some reason the tiles in the grid still have some space in between On the vertical position, horizontally, it looks okay, one cannot see where the tiles are merged together
My goal is to have a big 4096x4096 map made out of 1024x1024 tiles, attached is an example of how it looks like with the space between vertical positioning
Maybe my equations are wrong, maybe on overthinking it, but at this point I can use a fresh perspective( some pun intended)…
if there is a better way to do it, can you point me in the right direction?
Thanks!