imitating ground scrolling using offsetY and offsetX of material

Software: Away3D 3.x

Satyam I, Newbie
Posted: 26 September 2011 01:20 PM   Total Posts: 2

Hi, guys!

I’m working on small racing game (Away3d 3.6).
I want to show a ground under wheels of my car.
I placed a RedularPolygone on scene and move it to the same position where I have a car at the moment. I understand that I cannot place the ground of big size (like 10000x10000) because of perfomance. Right? So I use that polygone to simulate ground movement. I dont know how to move bitmapmaterial to correspond to car position change.
I dont know exactly what to do. I need code like this [every tick]:

floorMaterial.offsetX -= carSkin.carLastX;

 
floor.carSkin.x;
 
floor.carSkin.z;

 if (
floorMaterial.offsetX 0)
   
floorMaterial.offsetX += 512;
   
 
carLastX carSkin.x;
 
carLastZ carSkin.z

Please look at my demo
http://metaine.com/sites/undpv3d/bin-debug/Game.html - place a focus on game and use arrows to move the vehicle.

Thanks for helping me.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X