Sprite3D rotation

Software: Away3D 4.x

Xavirobot, Newbie
Posted: 05 August 2014 12:11 AM   Total Posts: 8

Hi all I’m trying to dynamically load images to 128x128 px engine anger loading tiles that field depending on the position of the camera but I encountered a problem that I can not solve, this is the sample code:

The following code is executed every time you load a “image.bmp” different in loaderR._Mvc.content and is placing one next to the other within “terrain: mesh” forming an infinite grid which is showing the tiles a mysql database as we go along.

var material:TextureMaterial = new TextureMaterial(Cast.bitmapTexture((Bitmap(loaderR._Mvc.content).bitmapData).clone())); 
var 
tileBmp:Sprite3D = new Sprite3D(material,128,128);
terrain.addChild(tileBmp);

tileBmp.BitmapW arrR[0][0];
tileBmp.BitmapW arrR[0][1];
tileBmp.name "terrain" arrABC[arrR[0][0]] arrR[0][0] arrR[0][1]


Well the problem comes when I want to rotate the terrain mesh with rotationY, the tiles instead of turning by the container “terrain: Mesh” they do not stand still and turn on themselves.

As I can make them stay still and rotate their container with “terrain / Mesh”?
from what I have read and understand terrain.lookAt should use the method but do not know how to use it.

Before using the Mesh class to display the tiles and did not have this problem, but I wanted to try Sprite3D because it gave me the feeling that it was more efficient for the task.

Another question, what is more efficient in terms of processing speed, use the Mesh class? or the Sprite3D class to create tiles in a container Mesh?.

In case you do not understand what I’m asking I can upload an example for my server so they can try, if so ask Me.

excuse my English, I used google translator.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X