当前位置: 首页>>代码示例>>Java>>正文


Java PointLight.setColor方法代码示例

本文整理汇总了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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:TestUnshadedModel.java

示例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);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:TestSimpleBumps.java

示例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);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:27,代码来源:TestNormalMapping.java

示例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);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:26,代码来源:TestBumpModel.java

示例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();
	}
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:24,代码来源:AbstractTorch.java

示例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);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:36,代码来源:TestLightRadius.java

示例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);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:41,代码来源:TestOgreLoading.java

示例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);
}
 
开发者ID:dwhuang,项目名称:SMILE,代码行数:13,代码来源:MainApp.java

示例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);
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:35,代码来源:TestJaimeJ3o.java

示例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);
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:35,代码来源:TestXbufWithMaterialHook.java

示例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;
}
 
开发者ID:samynk,项目名称:DArtE,代码行数:15,代码来源:GameSceneLoader.java

示例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);
}
 
开发者ID:mosstest,项目名称:mosstest,代码行数:8,代码来源:RenderProcessor.java

示例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);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:31,代码来源:TestNormalMapping.java

示例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);
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:40,代码来源:TestOgreLoading.java

示例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);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:15,代码来源:OffScenePanel.java


注:本文中的com.jme3.light.PointLight.setColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。