1

I am trying to create a scene with a infinite floor that seems to fade away in the distance in Away3d. I want the floor to have a texture. Prob is -- I can't seem to find any clear examples or tutorials that demonstrate this.

  • use plane geometry and apply a material to it? look at these samples if you see something you might find useful- https://github.com/away3d/away3d-examples-fp11/tree/master/src – Joe Slater Feb 20 '13 at 19:42

1 Answers1

2

Ok you need to set your scene up, import local libs etc here we go

          //Away3d
          import away3d.containers.Scene3D;
          import away3d.containers.View3D;
          //etc


          ////////3D ModelScenes, Textures CLASS Exported 3DS/////////////////////
          [Embed("assets/Images/grass1.jpg")]
          var GrassTexture:Class;
          var groundMaterial = new BitmapTexture(new GrassTexture().bitmapData);



           ////////GROUND MESH/////////////////////////////////////////////////////
           var plane = new Mesh(new PlaneGeometry(3000,3000,30,30),new       TextureMaterial(Cast.bitmapTexture(groundMaterial)));
           plane.geometry.scaleUV(25, 25);
           plane.material.repeat = true;
           plane.material.alpha = 1;
           container.addChild(plane);

Instead of tiling mesh/planes your better off having a really big plane and using the vertexes/polygons as tile locations...

Hope it helps

joshua
  • 676
  • 1
  • 5
  • 19
  • I don't understand how this translates into an infinite floor... isn't it a locked size of 3000x3000? – davidkomer Jun 16 '14 at 05:16
  • it is locked at 3000x3000 this is a simple example if the camera is static or only panning...using this method there are many tricks that can achieve the illusion of infinity floor whils moving the camera forward or back, example: if camera x == 1000 pixels then camera x = 0 ) reset camera back you wouldnt know the difference im sure there better ways to handle your scenerio – joshua Jul 03 '14 at 12:53