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


Java AmbientLight.setColor方法代码示例

本文整理汇总了Java中com.jme3.light.AmbientLight.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java AmbientLight.setColor方法的具体用法?Java AmbientLight.setColor怎么用?Java AmbientLight.setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.light.AmbientLight的用法示例。


在下文中一共展示了AmbientLight.setColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: simpleInitApp

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
@Override
    public void simpleInitApp() {
        Application a;
        flyCam = new ExtendedFlyByCam(cam);
        flyCam.setDragToRotate(true);
        flyCam.setMoveSpeed(50);
        flyCam.registerWithInput(getInputManager());

        EntityFactory pf = new EntityFactory(this, rootNode);        
        AbstractProp loadingEntity = pf.getProp("Prop/Manipulator/Manipulator-Creature_Load.csm.xml");
//        AbstractProp loadingSpatial = pf.getProp("Props/Prop-Manipulator/Manipulator-Sound.csm.xml");
        
        
        
//        MeshConfiguration meshConfig = MeshConfiguration.get(meshPath);
//        Material propMaterial = createMaterial(meshConfig, assetManager);
//        ((Geometry)loadingSpatial.getChild(0)).setMaterial(propMaterial);
        rootNode.attachChild(loadingEntity.getSpatial());
        
        AmbientLight al = new AmbientLight();
        al.setColor(ColorRGBA.White);
        rootNode.addLight(al);
    }
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:24,代码来源:TestLoading.java

示例2: simpleInitApp

import com.jme3.light.AmbientLight; //导入方法依赖的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

示例3: initFloor

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
public Spatial initFloor() {
        Material mat3 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        Geometry floor = new Geometry("floor", new Box(Vector3f.ZERO, 100f, 0.1f, 100f));
        
        mat3.setTexture("ColorMap", assetManager.loadTexture("Textures/test/_Pond.jpg"));
        floor.setMaterial(mat3);
        
//        Spatial floor = assetManager.loadModel("Models/env/terrain/treasure.j3o");
        
        AmbientLight light = new AmbientLight();
        light.setColor(ColorRGBA.White);
        rootNode.addLight(light);
        rootNode.addLight(new DirectionalLight());
        
        GeometryUtils.makeUnshaded(floor);
        
        this.rootNode.attachChild(floor);
        return floor;
    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:20,代码来源:ProjectTest.java

示例4: main

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
public static void main(String[] args)
{
   Logger.getLogger("").setLevel(Level.SEVERE);
   
   final SimpleApplication scene = new SimpleApplication()
   {
      @Override
      public void simpleInitApp()
      {
         getFlyByCamera().setMoveSpeed(10);
         getViewPort().setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f));
         
         DirectionalLight dl = new DirectionalLight();
         dl.setDirection(new Vector3f(0.69305897f, -0.51373863f, 0.5057093f).normalizeLocal());
         dl.setColor(new ColorRGBA(0.8f, 0.8f, 0.8f, 0.8f));
         getRootNode().addLight(dl);
         
         AmbientLight amb = new AmbientLight();
         amb.setColor(new ColorRGBA(3.7f, 3.5f, 3.9f, 1.0f));
         getRootNode().addLight(amb);
         
         onInit(this);
      }
   };
   scene.start();
}
 
开发者ID:mifth,项目名称:JME-Simple-Examples,代码行数:27,代码来源:DungeonRenderer.java

示例5: makeScene

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
private void makeScene()
	{
		DirectionalLight sun = new DirectionalLight();
		sun.setColor(ColorRGBA.White);
		sun.setDirection(new Vector3f(-.5f,-.5f,-.5f).normalizeLocal());
		rootNode.addLight(sun);
		
		AmbientLight al = new AmbientLight();
        al.setColor(ColorRGBA.White.mult(1.3f));
        rootNode.addLight(al);
        
		String file ="gui_desktop/img/plane.j3o";
		
		plane = assetManager.loadModel(file);
		plane.setLocalScale(0.75f);
		
//		plane = new Geometry("blue cube", new Box(Vector3f.ZERO, 1, 1, 1));
//        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
//        mat.setColor("Color", ColorRGBA.Blue);
//        plane.setMaterial(mat);
        
		rootNode.attachChild(plane);		
	}
 
开发者ID:Jupre,项目名称:MarmaraDrone,代码行数:24,代码来源:AttitudePanel.java

示例6: createLava

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
private void createLava() {
    Mesh mesh = modifyTextureCoordinates(new Quad(1024, 1024));        
    Geometry geom = new Geometry("lava-terrain", mesh);               
    
    Material lavaMaterial = 
            getAssetManager().loadMaterial("Materials/NewLava.j3m");
    geom.setMaterial(lavaMaterial);
    ((Node) getWorld().getWorldRoot()
            .getChild("terrain")).attachChild(geom);
    
    geom.lookAt(Vector3f.UNIT_Y, Vector3f.UNIT_X);
    geom.center();
    geom.move(0, -4, 0);

    AmbientLight ambientLight = new AmbientLight();
    ambientLight.setColor(ColorRGBA.White.mult(0.3f));
    getTerrainNode().getParent().addLight(ambientLight);
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:19,代码来源:PillarArena.java

示例7: createLavaQuad

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
private void createLavaQuad() {
    Quad quad = new Quad(512, 512, true);
    Geometry geom = new Geometry("lava-terrain", quad);
    Material lavaMat = getAssetManager()
            .loadMaterial("Materials/LavaTerrain.j3m");
    geom.setMaterial(lavaMat);
    ((Node) getWorld().getWorldRoot()
            .getChild("terrain")).attachChild(geom);

    geom.lookAt(Vector3f.UNIT_Y, Vector3f.UNIT_X);
    geom.setLocalTranslation(-256, -2, -256);

    AmbientLight ambientLight = new AmbientLight();
    ambientLight.setColor(ColorRGBA.White.mult(0.3f));
    getTerrainNode().getParent().addLight(ambientLight);
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:17,代码来源:BasicSquareArena.java

示例8: simpleInitApp

import com.jme3.light.AmbientLight; //导入方法依赖的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

示例9: afterPropertiesSet

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
    directionalLight = new DirectionalLight();
    directionalLight.setColor(ColorRGBA.White.mult(0.5f));
    directionalLight.setDirection(new Vector3f(0.0f, -1.0f, 0.0f));
    ambientLight = new AmbientLight();
    ambientLight.setColor(ColorRGBA.White.mult(0.15f));
    lights = new LinkedList<>();
    lights.add(directionalLight);
    lights.add(ambientLight);
    
    final int SHADOWMAP_SIZE = 4096;
    DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, SHADOWMAP_SIZE, 4);
    dlsr.setLight(directionalLight);
    dlsr.setShadowIntensity(0.3f);
    dlsr.setRenderBackFacesShadows(Boolean.TRUE);
    dlsr.setShadowCompareMode(CompareMode.Hardware);
    dlsr.setEdgeFilteringMode(EdgeFilteringMode.PCF8);
    camera.addEffect(dlsr);      
    float initialWaterHeight = 1500f; // choose a value for your scene
    /*water = new WaterFilter(rootNode, directionalLight.getDirection());
    water.setWaterHeight(initialWaterHeight);
    camera.addNearEffect(water);*/
    
    /*DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(assetManager, SHADOWMAP_SIZE, 3);
     dlsf.setLight(directionalLight);
     dlsf.setEnabled(true);
     camera.addNearEffect(dlsf);*/
}
 
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:30,代码来源:Lighting.java

示例10: setUpLight

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
private void setUpLight() {
    // We add light so we see the scene
    AmbientLight al = new AmbientLight();
    al.setColor(ColorRGBA.White.mult(1.3f));
    rootNode.addLight(al);

    DirectionalLight dl = new DirectionalLight();
    dl.setColor(ColorRGBA.White); 
    dl.setDirection(new Vector3f(2.8f, -2.8f, -2.8f).normalizeLocal());
    rootNode.addLight(dl);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:12,代码来源:HelloCollision.java

示例11: simpleInitApp

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
    cam.setLocation(new Vector3f(68.45442f, 8.235511f, 7.9676695f));
    cam.setRotation(new Quaternion(0.046916496f, -0.69500375f, 0.045538206f, 0.7160271f));


    flyCam.setMoveSpeed(50);

    Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
    Texture diff = assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg");
    diff.setWrap(Texture.WrapMode.Repeat);
    Texture norm = assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall_normal.jpg");
    norm.setWrap(Texture.WrapMode.Repeat);
    mat.setTexture("DiffuseMap", diff);
    mat.setTexture("NormalMap", norm);
    mat.setFloat("Shininess", 2.0f);


    AmbientLight al = new AmbientLight();
    al.setColor(new ColorRGBA(1.8f, 1.8f, 1.8f, 1.0f));

    rootNode.addLight(al);

    model = (Geometry) assetManager.loadModel("Models/Sponza/Sponza.j3o");
    model.getMesh().scaleTextureCoordinates(new Vector2f(2, 2));

    model.setMaterial(mat);

    rootNode.attachChild(model);

    FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
    SSAOFilter ssaoFilter = new SSAOFilter(12.940201f, 43.928635f, 0.32999992f, 0.6059958f);
    fpp.addFilter(ssaoFilter);
    SSAOUI ui = new SSAOUI(inputManager, ssaoFilter);

    viewPort.addProcessor(fpp);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:38,代码来源:TestSSAO.java

示例12: simpleInitApp

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
@Override
	public void simpleInitApp() {
		assetManager.registerLocator("assets/", FileLocator.class);

		// 关闭第一人称
//		flyCam.setEnabled(false);
		 this.getFlyByCamera().setMoveSpeed(30);
			cam.setFrustumPerspective(45, (float) cam.getWidth() / cam.getHeight(), 0.1F, 1000);
		AmbientLight amb = new AmbientLight();
		amb.setColor(new ColorRGBA(0.6F, 0.8F, 0.8F, 1.0f));
		rootNode.addLight(amb);

		DirectionalLight light = new DirectionalLight();
		light.setColor(new ColorRGBA(1.0f, 0.9f, 0.8f, 1.0f));
		light.setDirection(new Vector3f(0F, -0.779F, 0.627F));
		rootNode.addLight(light);

		role = new Node();
		rootNode.attachChild(role);
 
		
		
		// 第一步加载骨骼文件
		coatSke = (Node) assetManager.loadModel("Props/models/Ninja_ske.j3o");
		coatSke.scale(0.01F);
		rootNode.attachChild(coatSke);
		
		// 播放动画
		AnimControl animControl = coatSke.getControl(AnimControl.class);
		animControl.addListener(this);
		AnimChannel anim= animControl.createChannel();
		anim.setAnim("Attack1");
		
		
		keyMapping();
	}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:37,代码来源:TestRole.java

示例13: simpleInitApp

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
@Override
    public void simpleInitApp() {
//		assetManager.registerLocator("assets/", FileLocator.class);

        // 关闭第一人称
//		flyCam.setEnabled(false);
        this.getFlyByCamera().setMoveSpeed(30);
        cam.setFrustumPerspective(45, (float) cam.getWidth() / cam.getHeight(), 0.1F, 1000);
        AmbientLight amb = new AmbientLight();
        amb.setColor(new ColorRGBA(0.6F, 0.8F, 0.8F, 1.0f));
        rootNode.addLight(amb);

        DirectionalLight light = new DirectionalLight();
        light.setColor(new ColorRGBA(1.0f, 0.9f, 0.8f, 1.0f));
        light.setDirection(new Vector3f(0F, -0.779F, 0.627F));
        rootNode.addLight(light);

        // 第一步加载骨骼文件
        ske = (Node) assetManager.loadModel("Models/actor/ske.mesh.j3o");
        SkeletonControl sc = ske.getControl(SkeletonControl.class);
        
        CustomSkeletonControl csc = new CustomSkeletonControl(sc.getSkeleton());
        ske.removeControl(sc);
        ske.addControl(csc);
//        csc.setHardwareSkinningPreferred(true);
        

        rootNode.attachChild(ske);
        addSkeletonAnim(assetManager.loadModel("Models/actor/ext_anim/idle_run.mesh.j3o"), ske);
        // 加载初始化皮肤
        ske.attachChild(assetManager.loadModel("Models/actor/female/foot.003.mesh.j3o"));

        // 播放动画
        AnimControl animControl = ske.getControl(AnimControl.class);
        System.out.println(animControl.getAnimationNames().toString());
        anim = animControl.createChannel();
        anim.setAnim("idle_run");

        keyMapping();
    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:41,代码来源:RoleTest.java

示例14: simpleInitApp

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
    loadHintText();
    initCrossHairs();
    setupKeys();
    
    createMarker();

    // WIREFRAME material
    matWire = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    matWire.getAdditionalRenderState().setWireframe(true);
    matWire.setColor("Color", ColorRGBA.Green);
    
    createTerrain();
    //createTerrainGrid();
    
    DirectionalLight light = new DirectionalLight();
    light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize());
    rootNode.addLight(light);

    AmbientLight ambLight = new AmbientLight();
    ambLight.setColor(new ColorRGBA(1f, 1f, 0.8f, 0.2f));
    rootNode.addLight(ambLight);

    cam.setLocation(new Vector3f(0, 256, 0));
    cam.lookAtDirection(new Vector3f(0, -1f, 0).normalizeLocal(), Vector3f.UNIT_X);
}
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:28,代码来源:TerrainTestModifyHeight.java

示例15: initLights

import com.jme3.light.AmbientLight; //导入方法依赖的package包/类
private void initLights() {
    ambientLight = new AmbientLight();
    ambientLight.setColor(ColorRGBA.White);
    guiNode.addLight(ambientLight);

    selectionLight = new AmbientLight();
    selectionLight.setColor(ColorRGBA.Orange.mult(5));
}
 
开发者ID:mathiasj33,项目名称:JMEPieMenu,代码行数:9,代码来源:PieMenuState.java


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