本文整理汇总了Java中com.jme3.light.PointLight.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java PointLight.setColor方法的具体用法?Java PointLight.setColor怎么用?Java PointLight.setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.light.PointLight
的用法示例。
在下文中一共展示了PointLight.setColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simpleInitApp
import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Sphere sphMesh = new Sphere(32, 32, 1);
sphMesh.setTextureMode(Sphere.TextureMode.Projected);
sphMesh.updateGeometry(32, 32, 1, false, false);
TangentBinormalGenerator.generate(sphMesh);
Geometry sphere = new Geometry("Rock Ball", sphMesh);
Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
mat.setColor("Ambient", ColorRGBA.DarkGray);
mat.setColor("Diffuse", ColorRGBA.White);
mat.setBoolean("UseMaterialColors", true);
sphere.setMaterial(mat);
rootNode.attachChild(sphere);
PointLight pl = new PointLight();
pl.setColor(ColorRGBA.White);
pl.setPosition(new Vector3f(4f, 0f, 0f));
rootNode.addLight(pl);
AmbientLight al = new AmbientLight();
al.setColor(ColorRGBA.White);
rootNode.addLight(al);
}
示例2: simpleInitApp
import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Quad quadMesh = new Quad(1, 1);
Geometry sphere = new Geometry("Rock Ball", quadMesh);
Material mat = assetManager.loadMaterial("Textures/BumpMapTest/SimpleBump.j3m");
sphere.setMaterial(mat);
TangentBinormalGenerator.generate(sphere);
rootNode.attachChild(sphere);
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
rootNode.attachChild(lightMdl);
pl = new PointLight();
pl.setColor(ColorRGBA.White);
pl.setPosition(new Vector3f(0f, 0f, 4f));
rootNode.addLight(pl);
// DirectionalLight dl = new DirectionalLight();
// dl.setDirection(new Vector3f(1, -1, -1).normalizeLocal());
// dl.setColor(new ColorRGBA(0.22f, 0.15f, 0.1f, 1.0f));
// rootNode.addLight(dl);
}
示例3: simpleInitApp
import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Sphere sphMesh = new Sphere(32, 32, 1);
sphMesh.setTextureMode(Sphere.TextureMode.Projected);
sphMesh.updateGeometry(32, 32, 1, false, false);
TangentBinormalGenerator.generate(sphMesh);
Geometry sphere = new Geometry("Rock Ball", sphMesh);
Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
sphere.setMaterial(mat);
rootNode.attachChild(sphere);
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
rootNode.attachChild(lightMdl);
pl = new PointLight();
pl.setColor(ColorRGBA.White);
pl.setPosition(new Vector3f(0f, 0f, 4f));
rootNode.addLight(pl);
// DirectionalLight dl = new DirectionalLight();
// dl.setDirection(new Vector3f(1,-1,1).normalizeLocal());
// dl.setColor(new ColorRGBA(0.22f, 0.15f, 0.1f, 1.0f));
// rootNode.addLight(dl);
}
示例4: simpleInitApp
import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Spatial signpost = (Spatial) assetManager.loadAsset(new OgreMeshKey("Models/Sign Post/Sign Post.mesh.xml"));
signpost.setMaterial( (Material) assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m"));
TangentBinormalGenerator.generate(signpost);
rootNode.attachChild(signpost);
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMdl.setMaterial( (Material) assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
rootNode.attachChild(lightMdl);
// flourescent main light
pl = new PointLight();
pl.setColor(new ColorRGBA(0.88f, 0.92f, 0.95f, 1.0f));
rootNode.addLight(pl);
AmbientLight al = new AmbientLight();
al.setColor(new ColorRGBA(0.44f, 0.40f, 0.20f, 1.0f));
rootNode.addLight(al);
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(1,-1,-1).normalizeLocal());
dl.setColor(new ColorRGBA(0.92f, 0.85f, 0.8f, 1.0f));
rootNode.addLight(dl);
}
示例5: activate
import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
public void activate(Player player) {
if (!isPlaced) return;
isActive = !isActive;
if (isActive) {
light = new PointLight();
light.setColor(lightColor);
light.setRadius(lightRadius);
light.setPosition(getLocation().add(LIGHT_OFFSET));
world.getNode().addLight(light);
slow = new SlowInRadius(getLocation(), slowRadius, slowPower);
// if you are not the client, create the slow effect
if(world.getWorldType() != WorldType.CLIENT)
world.makeLocalEffect(slow);
} else {
onDeactivate();
}
}
示例6: simpleInitApp
import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Torus torus = new Torus(10, 6, 1, 3);
// Torus torus = new Torus(50, 30, 1, 3);
Geometry g = new Geometry("Torus Geom", torus);
g.rotate(-FastMath.HALF_PI, 0, 0);
g.center();
// g.move(0, 1, 0);
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
mat.setFloat("Shininess", 32f);
mat.setBoolean("UseMaterialColors", true);
mat.setColor("Ambient", ColorRGBA.Black);
mat.setColor("Diffuse", ColorRGBA.White);
mat.setColor("Specular", ColorRGBA.White);
// mat.setBoolean("VertexLighting", true);
// mat.setBoolean("LowQuality", true);
g.setMaterial(mat);
rootNode.attachChild(g);
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
rootNode.attachChild(lightMdl);
pl = new PointLight();
pl.setColor(ColorRGBA.Green);
pl.setRadius(4f);
rootNode.addLight(pl);
DirectionalLight dl = new DirectionalLight();
dl.setColor(ColorRGBA.Red);
dl.setDirection(new Vector3f(0, 1, 0));
rootNode.addLight(dl);
}
示例7: simpleInitApp
import com.jme3.light.PointLight; //导入方法依赖的package包/类
public void simpleInitApp()
{
// PointLight pl = new PointLight();
// pl.setPosition(new Vector3f(10, 10, -10));
// rootNode.addLight(pl);
flyCam.setMoveSpeed(10f);
// sunset light
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -0.7f, 1).normalizeLocal());
dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
rootNode.addLight(dl);
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMdl.setMaterial( (Material) assetManager.loadAsset("Common/Materials/RedColor.j3m"));
rootNode.attachChild(lightMdl);
lightMd2 = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMd2.setMaterial( (Material) assetManager.loadAsset("Common/Materials/WhiteColor.j3m"));
rootNode.attachChild(lightMd2);
pl = new PointLight();
pl.setColor(new ColorRGBA(1, 0.9f, 0.9f, 0));
pl.setPosition(new Vector3f(0f, 0f, 4f));
rootNode.addLight(pl);
p2 = new PointLight();
p2.setColor(new ColorRGBA(0.9f, 1, 0.9f, 0));
p2.setPosition(new Vector3f(0f, 0f, 3f));
rootNode.addLight(p2);
// create the geometry and attach it
Spatial elephant = (Spatial) assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
float scale = 0.05f;
elephant.scale(scale,scale,scale);
rootNode.attachChild(elephant);
}
示例8: initLighting
import com.jme3.light.PointLight; //导入方法依赖的package包/类
private void initLighting() {
// lights
AmbientLight ambientLight = new AmbientLight();
//ambientLight.setColor(ColorRGBA.White.mult(1f));
rootNode.addLight(ambientLight);
PointLight light = new PointLight();
light.setColor(ColorRGBA.White);
light.setPosition(new Vector3f(0f, 10f, 0f));
light.setRadius(50f);
rootNode.addLight(light);
}
示例9: setupLights
import com.jme3.light.PointLight; //导入方法依赖的package包/类
public void setupLights() {
AmbientLight al = new AmbientLight();
al.setColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 1));
rootNode.addLight(al);
SpotLight sl = new SpotLight();
sl.setColor(ColorRGBA.White.mult(1.0f));
sl.setPosition(new Vector3f(1.2074411f, 10.6868908f, 4.1489987f));
sl.setDirection(sl.getPosition().mult(-1));
sl.setSpotOuterAngle(0.1f);
sl.setSpotInnerAngle(0.004f);
rootNode.addLight(sl);
//pointlight to fake indirect light coming from the ground
PointLight pl = new PointLight();
pl.setColor(ColorRGBA.White.mult(1.5f));
pl.setPosition(new Vector3f(0, 0, 1));
pl.setRadius(2);
rootNode.addLight(pl);
SpotLightShadowRenderer shadows = new SpotLightShadowRenderer(assetManager, 1024);
shadows.setLight(sl);
shadows.setShadowIntensity(0.3f);
shadows.setEdgeFilteringMode(EdgeFilteringMode.PCF8);
viewPort.addProcessor(shadows);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
SSAOFilter filter = new SSAOFilter(0.10997847f,0.440001f,0.39999998f,-0.008000026f);;
fpp.addFilter(filter);
fpp.addFilter(new FXAAFilter());
fpp.addFilter(new FXAAFilter());
viewPort.addProcessor(fpp);
}
示例10: setupLights
import com.jme3.light.PointLight; //导入方法依赖的package包/类
public void setupLights() {
AmbientLight al = new AmbientLight();
al.setColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 1));
rootNode.addLight(al);
SpotLight sl = new SpotLight();
sl.setColor(ColorRGBA.White.mult(1.0f));
sl.setPosition(new Vector3f(1.2074411f, 10.6868908f, 4.1489987f));
sl.setDirection(sl.getPosition().mult(-1));
sl.setSpotOuterAngle(0.1f);
sl.setSpotInnerAngle(0.004f);
rootNode.addLight(sl);
//pointlight to fake indirect light coming from the ground
PointLight pl = new PointLight();
pl.setColor(ColorRGBA.White.mult(1.5f));
pl.setPosition(new Vector3f(0, 0, 1));
pl.setRadius(2);
rootNode.addLight(pl);
SpotLightShadowRenderer shadows = new SpotLightShadowRenderer(assetManager, 1024);
shadows.setLight(sl);
shadows.setShadowIntensity(0.3f);
shadows.setEdgeFilteringMode(EdgeFilteringMode.PCF8);
viewPort.addProcessor(shadows);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
SSAOFilter filter = new SSAOFilter(0.10997847f,0.440001f,0.39999998f,-0.008000026f);;
fpp.addFilter(filter);
fpp.addFilter(new FXAAFilter());
fpp.addFilter(new FXAAFilter());
viewPort.addProcessor(fpp);
}
示例11: createPointLight
import com.jme3.light.PointLight; //导入方法依赖的package包/类
private static PointLight createPointLight(NamedNodeMap map) {
Vector3f translation = XMLUtils.parseFloat3(getAttrContent("translation", map));
ColorRGBA color = XMLUtils.parseColor(getAttrContent("color", map));
float intensity = XMLUtils.parseFloat("intensity", map);
float radius = XMLUtils.parseFloat("radius", map);
String name = getAttrContent("name", map);
PointLight pointlight = new PointLight();
pointlight.setName(name);
pointlight.setPosition(translation);
pointlight.setRadius(radius);
pointlight.setColor(color.mult(intensity));
return pointlight;
}
示例12: setupLamplight
import com.jme3.light.PointLight; //导入方法依赖的package包/类
private void setupLamplight() {
lamp = new PointLight();
lamp.setColor(ColorRGBA.Yellow);
lamp.setRadius(4f);
lamp.setPosition(cam.getLocation());
rootNode.addLight(lamp);
}
示例13: simpleInitApp
import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Sphere sphMesh = new Sphere(32, 32, 1);
sphMesh.setTextureMode(Sphere.TextureMode.Projected);
sphMesh.updateGeometry(32, 32, 1, false, false);
TangentBinormalGenerator.generate(sphMesh);
Geometry sphere = new Geometry("Rock Ball", sphMesh);
Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
sphere.setMaterial(mat);
rootNode.attachChild(sphere);
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
rootNode.attachChild(lightMdl);
pl = new PointLight();
pl.setColor(ColorRGBA.White);
pl.setPosition(new Vector3f(0f, 0f, 4f));
rootNode.addLight(pl);
AmbientLight al = new AmbientLight();
al.setColor(new ColorRGBA(0.44f, 0.40f, 0.20f, 1.0f));
rootNode.addLight(al);
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(1,-1,-1).normalizeLocal());
dl.setColor(new ColorRGBA(0.92f, 0.85f, 0.8f, 1.0f));
rootNode.addLight(dl);
}
示例14: simpleInitApp
import com.jme3.light.PointLight; //导入方法依赖的package包/类
public void simpleInitApp() {
// PointLight pl = new PointLight();
// pl.setPosition(new Vector3f(10, 10, -10));
// rootNode.addLight(pl);
flyCam.setMoveSpeed(10f);
// sunset light
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -0.7f, 1).normalizeLocal());
dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
rootNode.addLight(dl);
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
rootNode.attachChild(lightMdl);
lightMd2 = new Geometry("Light", new Sphere(10, 10, 0.1f));
lightMd2.setMaterial(assetManager.loadMaterial("Common/Materials/WhiteColor.j3m"));
rootNode.attachChild(lightMd2);
pl = new PointLight();
pl.setColor(new ColorRGBA(1, 0.9f, 0.9f, 0));
pl.setPosition(new Vector3f(0f, 0f, 4f));
rootNode.addLight(pl);
p2 = new PointLight();
p2.setColor(new ColorRGBA(0.9f, 1, 0.9f, 0));
p2.setPosition(new Vector3f(0f, 0f, 3f));
rootNode.addLight(p2);
// create the geometry and attach it
Spatial elephant = (Spatial) assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
float scale = 0.05f;
elephant.scale(scale, scale, scale);
rootNode.attachChild(elephant);
}
示例15: setupScene
import com.jme3.light.PointLight; //导入方法依赖的package包/类
private void setupScene() {
//setup framebuffer's cam
camera.setFrustumPerspective(45f, 1f, 1f, 1000f);
camera.setLocation(new Vector3f(5f, 5f, 5f));
camera.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);
// setup framebuffer's scene
light = new PointLight();
light.setPosition(camera.getLocation());
light.setColor(ColorRGBA.White);
rootNode.addLight(light);
// attach the scene to the viewport to be rendered
viewPort.attachScene(rootNode);
}