private void initSkyBox() { skybox = new SkyBox("SkyBox", 20.0f, 20.0f, 20.0f); Texture nTexture = TextureManager.loadTexture2D("src/Textures/SkyBox/northSkybox.bmp"); Texture sTexture = TextureManager.loadTexture2D("src/Textures/SkyBox/southSkybox.bmp"); Texture eTexture = TextureManager.loadTexture2D("src/Textures/SkyBox/eastSkybox.bmp"); Texture wTexture = TextureManager.loadTexture2D("src/Textures/SkyBox/westSkybox.bmp"); Texture uTexture = TextureManager.loadTexture2D("src/Textures/SkyBox/upSkybox.bmp"); skybox.setTexture(SkyBox.Face.North, nTexture); skybox.setTexture(SkyBox.Face.South, sTexture); skybox.setTexture(SkyBox.Face.East, eTexture); skybox.setTexture(SkyBox.Face.West, wTexture); skybox.setTexture(SkyBox.Face.Up, uTexture); addGameWorldObject(skybox); }
private void initPlayers() { File file = new File(File.pathSeparator); System.out.println(file.getAbsolutePath()); OgreXMLParser loader = new OgreXMLParser(); try { model = loader.loadModel( "src/animated_objects/Cube.mesh.xml", "src/animated_objects/chicken.material", "src/animated_objects/Cube.skeleton.xml"); model.updateGeometricState(0, true); java.util.Iterator<SceneNode> modelIterator = model.iterator(); player1 = (Model3DTriMesh) modelIterator.next(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } Texture chickenTexture = TextureManager.loadTexture2D("src/animated_objects/green_chicken.jpg"); chickenTexture.setApplyMode(sage.texture.Texture.ApplyMode.Replace); chickenTextureState = (TextureState) display.getRenderer().createRenderState(RenderState.RenderStateType.Texture); chickenTextureState.setTexture(chickenTexture, 0); chickenTextureState.setEnabled(true); player1.setRenderState(chickenTextureState); player1.updateRenderStates(); player = physicsEngine.addSphereObject( physicsEngine.nextUID(), ballMass, player1.getWorldTransform().getValues(), 1.0f); player.setBounciness(0.0f); player1.setPhysicsObject(player); player1.scale(.35f, .35f, .35f); addGameWorldObject(player1); // player1.translate(133f, 13f, 123f); playerInitM = new Matrix3D(); playerInitM.concatenate((Matrix3D) player1.getLocalTranslation().clone()); playerInitM.concatenate((Matrix3D) player1.getLocalRotation().clone()); playerInitM.concatenate((Matrix3D) player1.getLocalScale().clone()); camera1 = new JOGLCamera(renderer); camera1.setPerspectiveFrustum(60, 1, 1, 1000); camera1.setViewport(0.0, 1.0, 0.0, 1); }