pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); PointLight.Attenuation att = new PointLight.Attenuation(0.0f, 0.0f, 1.0f); pointLight.setAttenuation(att); pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); att = new PointLight.Attenuation(0.0f, 0.0f, 0.02f); pointLight.setAttenuation(att); Vector3f coneDir = new Vector3f(0, 0, -1); float cutoff = (float) Math.cos(Math.toRadians(140));
PointLight pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); PointLight.Attenuation att = new PointLight.Attenuation(0.0f, 0.0f, 1.0f); pointLight.setAttenuation(att); pointLightList = new PointLight[]{pointLight}; pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); att = new PointLight.Attenuation(0.0f, 0.0f, 0.02f); pointLight.setAttenuation(att); Vector3f coneDir = new Vector3f(0, 0, -1); float cutoff = (float) Math.cos(Math.toRadians(140));
@Override public void init(Window window) throws Exception { renderer.init(window); float reflectance = 1f; //Mesh mesh = OBJLoader.loadMesh("/models/bunny.obj"); //Material material = new Material(new Vector3f(0.2f, 0.5f, 0.5f), reflectance); Mesh mesh = OBJLoader.loadMesh("/models/cube.obj"); Texture texture = new Texture("/textures/grassblock.png"); Material material = new Material(texture, reflectance); mesh.setMaterial(material); GameItem gameItem = new GameItem(mesh); gameItem.setScale(0.5f); gameItem.setPosition(0, 0, -2); gameItems = new GameItem[]{gameItem}; ambientLight = new Vector3f(0.3f, 0.3f, 0.3f); Vector3f lightColour = new Vector3f(1, 1, 1); Vector3f lightPosition = new Vector3f(0, 0, 1); float lightIntensity = 1.0f; pointLight = new PointLight(lightColour, lightPosition, lightIntensity); PointLight.Attenuation att = new PointLight.Attenuation(0.0f, 0.0f, 1.0f); pointLight.setAttenuation(att); }
PointLight pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); PointLight.Attenuation att = new PointLight.Attenuation(0.0f, 0.0f, 1.0f); pointLight.setAttenuation(att); sceneLight.setPointLightList(new PointLight[]{pointLight}); pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); att = new PointLight.Attenuation(0.0f, 0.0f, 0.02f); pointLight.setAttenuation(att); Vector3f coneDir = new Vector3f(0, 0, -1); float cutoff = (float) Math.cos(Math.toRadians(140));
PointLight pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); PointLight.Attenuation att = new PointLight.Attenuation(0.0f, 0.0f, 1.0f); pointLight.setAttenuation(att); sceneLight.setPointLightList(new PointLight[]{pointLight}); pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); att = new PointLight.Attenuation(0.0f, 0.0f, 0.02f); pointLight.setAttenuation(att); Vector3f coneDir = new Vector3f(0, 0, -1); float cutoff = (float) Math.cos(Math.toRadians(140));
PointLight pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); PointLight.Attenuation att = new PointLight.Attenuation(0.0f, 0.0f, 1.0f); pointLight.setAttenuation(att); sceneLight.setPointLightList(new PointLight[]{pointLight}); pointLight = new PointLight(new Vector3f(1, 1, 1), lightPosition, lightIntensity); att = new PointLight.Attenuation(0.0f, 0.0f, 0.02f); pointLight.setAttenuation(att); Vector3f coneDir = new Vector3f(0, 0, -1); float cutoff = (float) Math.cos(Math.toRadians(140));
@Override public void init(Window window) throws Exception { renderer.init(window); float reflectance = 1f; //Mesh mesh = OBJLoader.loadMesh("/models/bunny.obj"); //Material material = new Material(new Vector3f(0.2f, 0.5f, 0.5f), reflectance); Mesh mesh = OBJLoader.loadMesh("/models/cube.obj"); Texture texture = new Texture("/textures/grassblock.png"); Material material = new Material(texture, reflectance); mesh.setMaterial(material); GameItem gameItem = new GameItem(mesh); gameItem.setScale(0.5f); gameItem.setPosition(0, 0, -2); //gameItem.setPosition(0, 0, -2); //gameItem.setScale(0.1f); //gameItem.setPosition(0, 0, -2); //gameItem.setPosition(0, 0, -0.2f); gameItems = new GameItem[]{gameItem}; ambientLight = new Vector3f(0.3f, 0.3f, 0.3f); Vector3f lightColour = new Vector3f(1, 1, 1); Vector3f lightPosition = new Vector3f(0, 0, 1); float lightIntensity = 1.0f; pointLight = new PointLight(lightColour, lightPosition, lightIntensity); PointLight.Attenuation att = new PointLight.Attenuation(0.0f, 0.0f, 1.0f); pointLight.setAttenuation(att); lightPosition = new Vector3f(-1, 0, 0); lightColour = new Vector3f(1, 1, 1); directionalLight = new DirectionalLight(lightColour, lightPosition, lightIntensity); }