public void createLight(GVRContext context) { bulbScene = new GVRSceneObject(context); bulb = new GVRSpotLight(context); bulbScene.attachLight(bulb); setDefaultLight(); bulb.setInnerConeAngle(100); bulb.setOuterConeAngle(100); }
public void createLight(GVRContext context) { bulbScene = new GVRSceneObject(context); bulb = new GVRSpotLight(context); bulbScene.attachLight(bulb); setDefaultLight(); bulb.setInnerConeAngle(100); bulb.setOuterConeAngle(100); }
public static GVRSceneObject createPointLight(GVRContext context, float x, float y, float z) { GVRSceneObject lightObject = new GVRSceneObject(context); GVRPointLight light = new GVRPointLight(context); float ambientIntensity = 0.5f; float diffuseIntensity = 1.0f; light.setAmbientIntensity(1.0f * ambientIntensity, 0.95f * ambientIntensity, 0.83f * ambientIntensity, 0.0f); light.setDiffuseIntensity(1.0f * diffuseIntensity, 0.95f * diffuseIntensity, 0.83f * diffuseIntensity, 0.0f); light.setSpecularIntensity(0.0f, 0.0f, 0.0f, 0.0f); //lightObject.getTransform().setScale(1.0f, 1.0f, 5.0f); lightObject.getTransform().setPosition(x, y, z); lightObject.attachLight(light); return lightObject; }
public static GVRSceneObject createDirectLight(GVRContext context, float x, float y, float z) { GVRSceneObject lightObject = new GVRSceneObject(context); GVRDirectLight light = new GVRDirectLight(context); light.setCastShadow(true); float ambientIntensity = 0.1f; float diffuseIntensity = 1.0f; light.setAmbientIntensity(1.0f * ambientIntensity, 0.95f * ambientIntensity, 0.83f * ambientIntensity, 0.0f); light.setDiffuseIntensity(1.0f * diffuseIntensity, 0.95f * diffuseIntensity, 0.83f * diffuseIntensity, 0.0f); light.setSpecularIntensity(0.0f, 0.0f, 0.0f, 0.0f); lightObject.getTransform().setPosition(x, y, z); lightObject.attachLight(light); return lightObject; }
private GVRSceneObject createLight(GVRContext context, float r, float g, float b, float y) { GVRSceneObject lightNode = new GVRSceneObject(context); GVRSpotLight light = new GVRSpotLight(context); lightNode.attachLight(light); lightNode.getTransform().setPosition(0, 0.5f, 0); light.setAmbientIntensity(0.7f * r, 0.7f * g, 0.7f * b, 1); light.setDiffuseIntensity(r , g , b , 1); light.setSpecularIntensity(r, g, b, 1); light.setInnerConeAngle(20); light.setOuterConeAngle(30); return lightNode; }
private GVRSceneObject createLight(GVRContext context, float r, float g, float b, Vector3f position) { GVRSceneObject lightNode = new GVRSceneObject(context); GVRPointLight light = new GVRPointLight(context); lightNode.attachLight(light); lightNode.getTransform().setPosition(0, 0.5f, 0); light.setAmbientIntensity(0.7f * r, 0.7f * g, 0.7f * b, 1); light.setDiffuseIntensity(r , g , b , 1); light.setSpecularIntensity(r, g, b, 1); lightNode.getTransform().setPosition(position.x,position.y,position.z); return lightNode; }
private GVRSceneObject createLight(GVRContext context, float r, float g, float b, float y) { GVRSceneObject lightNode = new GVRSceneObject(context); GVRSpotLight light = new GVRSpotLight(context); Quaternionf q = new Quaternionf(); lightNode.attachLight(light); lightNode.getTransform().setPosition(0, y, 3); light.setAmbientIntensity(0.3f * r, 0.3f * g, 0.3f * b, 1); light.setDiffuseIntensity(r, g, b, 1); light.setSpecularIntensity(r, g, b, 1); light.setInnerConeAngle(8); light.setOuterConeAngle(12); return lightNode; }
private GVRSceneObject createDirectLight(GVRContext context) { GVRSceneObject lightNode = new GVRSceneObject(context); GVRDirectLight light = new GVRDirectLight(context); light.setCastShadow(true); lightNode.attachLight(light); light.setShadowRange(1.0f, 150.0f); lightNode.getTransform().setRotationByAxis(-70, 1, 0, 0); light.setAmbientIntensity(0.3f, 0.3f, 0.3f, 1); light.setDiffuseIntensity(1, 1, 1, 1); light.setSpecularIntensity(1, 1, 1, 1); light.setShadowRange(1f, 150.0f); lightNode.setName("DirectLight"); return lightNode; }
private void addLight() { final GVRContext context = getGVRContext(); final GVRSpotLight light = new GVRSpotLight(context); light.setAmbientIntensity(0.8f, 0.8f, 0.8f, 1); light.setDiffuseIntensity(0.8f, 0.8f, 0.8f, 1); light.setSpecularIntensity(0.8f, 0.8f, 0.8f, 1); light.setInnerConeAngle(8); light.setOuterConeAngle(24); final GVRSceneObject lightNode = new GVRSceneObject(context); lightNode.attachLight(light); lightNode.getTransform().setPosition(0, 1, 3); context.getMainScene().addSceneObject(lightNode); }
private GVRSceneObject createSpotLight(GVRContext context) { GVRSceneObject lightNode = new GVRSceneObject(context); GVRSpotLight light = new GVRSpotLight(context); light.setCastShadow(true); lightNode.attachLight(light); lightNode.getTransform().setRotationByAxis(-35, 1, 0, 0); lightNode.getTransform().setPosition(-4, 7, 10); light.setAmbientIntensity(0.3f, 0.3f, 0.3f, 1); light.setDiffuseIntensity(1, 1, 1, 1); light.setSpecularIntensity(1, 1, 1, 1); light.setInnerConeAngle(40); light.setOuterConeAngle(55); light.setShadowRange(0.2f, 100.0f); lightNode.setName("SpotLight"); return lightNode; }
topLightObj.getTransform().rotateByAxis(-45, 1, 0, 0); mScene.addSceneObject(topLightObj); rig.getOwnerObject().attachLight(headLight); rig.getTransform().setPositionY(-0.5f); rig.getRightCamera().setBackgroundColor(Color.BLUE);