libgdx - Lighting renderable -


Please tell me what I did, the light has been applied to a model, but I am not able to present my environment Has installed, but it does not work.

Impact: The cube is using the environment, but not my figure.

  Generate Public Zero () {Environment = New Environment (); Environmental. Set (new color attribute (color oriental ambient light, 0.4 f, 0.4 f, 0.4 f, 1f)); Environment.add (new directlight (.) Set (1f, 0.8 f, 0.8 f, -1f, -0.8 f, -0.2 f)); Cam = new perspective camera (67, gdx graphics .getWidth (), gdx. Graphics.getHeight ()); Cam.position.set (6f, 0f, 0f); Cam.lookAt (0,0,0); Cam.near = 1f; Cam.far = 300f; CamController = new camera interface controller (cam); Gdx.input.setInputProcessor (camController); Cam.update (); Trap = New Aries (True, 40, 60, Vertx Arti.Position), Vertex Unbreakable Texas (0)); Mesh.setVertices (new float [] {0f, 0f, 1f, 0, 0, 1f, 0f, 0f, 1, 0, 1f, -1f, 0f, 1, 1, 1f, 1f, 0f, 1, 1, 0f, 1f, 0f, 0, 1, 0f, -1f, 0f, 0, 1, -1f, -1f, 0f, 1, 1, -1f, 0f, 0f, 1, 0, -1f, 1f, 0f , 1 1}); Mesh.setIndices (new small) [4,8,7,7,6,5,5,2,1,1,3,4,4,0,1,1,5,5,5,0,7, 7,0,4}); Content content = new content (); Texture = New Texture (Gdx.files.local ("grass.jpg")); Material.set (TextureAttribute.createDiffuse (textured)); ModelBlinderModelBolder = new model maker (); Model = ModelBuilder.Createbox (2f, 2f, 2f, Content, Usage Composition | Usage Normal | Usage Mixing); Example = new model human (model); Instance.materials.get (0) .Set (TextureAttribute.createDiffuse (textured)); Example.transform.setTranslation (new vector 3 (0,3,0)); Render = new renderable (); Rend.mesh = net; Rend.meshPartSize = 40; Rend.primitiveType = GL20.GL_TRIANGLES; Rend.material = Content; Rend.environment = environment; Modbatch = new modellatch (); } @ Override Public Zero Render () {Gdx.gl.glViewport (0, 0, Gdx.graphics.getWidth), Gdx.graphics.getHeight ()); Gdx.gl.glClear (GL20.GL_COLOR_BUFFER_BIT | GL 20.GL_DEPTH_BUFFER_BIT); Gdx.gl20.glClearColor (0.2f, 0.2f, 0.2f, 1); CamController.update (); Modbatch.begin (cam); Modbatch.render (Rewind); Modbatch.render (e.g., environment); Modbatch.end (); }  

Too much code.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -