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


Java AmbientLight类代码示例

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


AmbientLight类属于com.jme3.light包,在下文中一共展示了AmbientLight类的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: actionPerformed

import com.jme3.light.AmbientLight; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    SceneApplication.getApplication().enqueue(new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            AmbientLight light = new AmbientLight();
            light.setName("AmbientLight");
            light.setColor(ColorRGBA.White);
            node.addLight(light);
            addLightUndo(node, light);
            setModified();
            return null;
        }
    });
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:17,代码来源:NewLightPopup.java

示例4: createSheet

import com.jme3.light.AmbientLight; //导入依赖的package包/类
@Override
protected Sheet createSheet() {
    //TODO: multithreading..
    Sheet sheet = super.createSheet();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.setDisplayName("AmbientLight");
    set.setName(AmbientLight.class.getName());
    AmbientLight obj = AmbientLight;//getLookup().lookup(Spatial.class);
    if (obj == null) {
        return sheet;
    }

    sheet.put(set);
    return sheet;

}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:17,代码来源:JmeAmbientLight.java

示例5: 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

示例6: simpleInitApp

import com.jme3.light.AmbientLight; //导入依赖的package包/类
@Override
public void simpleInitApp() {
    inputManager.setCursorVisible(true);
    flyCam.setDragToRotate(true);
    flyCam.setMoveSpeed(10);
    rootNode.addLight(new DirectionalLight());
    rootNode.addLight(new AmbientLight());

    for (int i = 0; i < 10; i++) {
        Spatial sinbad = this.assetManager.loadModel("Models/Sinbad.mesh.j3o");

        sinbad.setLocalScale(0.5f);
        sinbad.setLocalTranslation(5 * FastMath.nextRandomFloat() - 2.5f, 5 * FastMath.nextRandomFloat() - 2.5f, 5 * FastMath.nextRandomFloat() - 2.5f);
        sinbad.getControl(AnimControl.class).createChannel().setAnim("run");
        this.rootNode.attachChild(sinbad);
    }
    System.out.println("TestJmeApp started......");
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:19,代码来源:JmeAppTest.java

示例7: simpleInitApp

import com.jme3.light.AmbientLight; //导入依赖的package包/类
@Override
    public void simpleInitApp() {
        flyCam.setMoveSpeed(10);

        rootNode.addLight(new AmbientLight());
        rootNode.addLight(new DirectionalLight());
        
//        Spatial model = assetManager.loadModel("Models/plants/Flower-242.j3o");
        Spatial model = assetManager.loadModel("Models/plants/Bush-1086.j3o");
        Spatial clone = model.clone(true);
        converterMaterial(clone, Arrays.asList("Bush-1086-geom-0"));
        
        for (int i = 0; i < 5; i++) {
            Spatial m = clone.clone();
            m.setLocalTranslation(FastMath.nextRandomFloat() * 15, 0, FastMath.nextRandomFloat() * 15);
            rootNode.attachChild(m);
        }
    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:19,代码来源:GrassTest.java

示例8: 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

示例9: setupDefaultScene

import com.jme3.light.AmbientLight; //导入依赖的package包/类
public void setupDefaultScene() {
	app.enqueue(()->{
		Node anchor = app.getRootNode();
		if (options.addGrid) {
			anchor.attachChild(Helper.makeScene(app));
		}
		if (options.addLights) {
			DirectionalLight dl = new DirectionalLight();
			dl.setColor(ColorRGBA.White);
			dl.setDirection(Vector3f.UNIT_XYZ.negate());
			anchor.addLight(dl);

			AmbientLight al = new AmbientLight();
			al.setColor(new ColorRGBA(0.2f, 0.2f, 0.2f, 1.0f));
			anchor.addLight(al);
		}
		return null;
	});
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:20,代码来源:ModelViewer.java

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: simpleInitApp

import com.jme3.light.AmbientLight; //导入依赖的package包/类
@Override
public void simpleInitApp() {  
    makeTerrain();
    flyCam.setMoveSpeed(50);

    sl = new SpotLight();
    sl.setSpotRange(100);
    sl.setSpotOuterAngle(20 * FastMath.DEG_TO_RAD);
    sl.setSpotInnerAngle(15 * FastMath.DEG_TO_RAD);
    sl.setDirection(new Vector3f(-0.39820394f, -0.73094344f, 0.55421597f));
    sl.setPosition(new Vector3f(-64.61567f, -87.615425f, -202.41328f));
    rootNode.addLight(sl);

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

    cam.setLocation(new Vector3f(-41.219646f, -84.8363f, -171.67267f));
    cam.setRotation(new Quaternion(-0.04562731f, 0.89917684f, -0.09668826f, -0.4243236f));
    sl.setDirection(cam.getDirection());
    sl.setPosition(cam.getLocation());

}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:24,代码来源:TestSpotLightTerrain.java

示例15: getName

import com.jme3.light.AmbientLight; //导入依赖的package包/类
@Override
@FromAnyThread
public @NotNull String getName() {
    final AmbientLight element = getElement();
    final String name = element.getName();
    return StringUtils.isEmpty(name) ? Messages.MODEL_FILE_EDITOR_NODE_AMBIENT_LIGHT : name;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:8,代码来源:AmbientLightTreeNode.java


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