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


Java WrapMode类代码示例

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


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

示例1: initMaterials

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
/** Initialize the materials used in this scene. */
public void initMaterials() {
  wall_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  TextureKey key = new TextureKey("Textures/Terrain/BrickWall/BrickWall.jpg");
  key.setGenerateMips(true);
  Texture tex = assetManager.loadTexture(key);
  wall_mat.setTexture("ColorMap", tex);

  stone_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  TextureKey key2 = new TextureKey("Textures/Terrain/Rock/Rock.PNG");
  key2.setGenerateMips(true);
  Texture tex2 = assetManager.loadTexture(key2);
  stone_mat.setTexture("ColorMap", tex2);

  floor_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  TextureKey key3 = new TextureKey("Textures/Terrain/Pond/Pond.png");
  key3.setGenerateMips(true);
  Texture tex3 = assetManager.loadTexture(key3);
  tex3.setWrap(WrapMode.Repeat);
  floor_mat.setTexture("ColorMap", tex3);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:22,代码来源:HelloPhysics.java

示例2: initMaterial

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
public void initMaterial() {
    mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key = new TextureKey("Textures/Terrain/BrickWall/BrickWall.jpg");
    key.setGenerateMips(true);
    Texture tex = assetManager.loadTexture(key);
    mat.setTexture("ColorMap", tex);

    mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key2 = new TextureKey("Textures/Terrain/Rock/Rock.PNG");
    key2.setGenerateMips(true);
    Texture tex2 = assetManager.loadTexture(key2);
    mat2.setTexture("ColorMap", tex2);

    mat3 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key3 = new TextureKey("Textures/Terrain/Pond/Pond.png");
    key3.setGenerateMips(true);
    Texture tex3 = assetManager.loadTexture(key3);
    tex3.setWrap(WrapMode.Repeat);
    mat3.setTexture("ColorMap", tex3);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:TestBrickWall.java

示例3: readTextureUnitStatement

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
private void readTextureUnitStatement(){
    String keyword = scan.next();
    if (keyword.equals("texture")){
        readTextureImage();
    }else if (keyword.equals("tex_address_mode")){
        String mode = scan.next();
        if (mode.equals("wrap")){
            texture.setWrap(WrapMode.Repeat);
        }else if (mode.equals("clamp")){
            texture.setWrap(WrapMode.Clamp);
        }else if (mode.equals("mirror")){
            texture.setWrap(WrapMode.MirroredRepeat);
        }else if (mode.equals("border")){
            texture.setWrap(WrapMode.BorderClamp);
        }
    }else if (keyword.equals("filtering")){
        // ignored.. only anisotropy is considered
        readString("\n");
    }else if (keyword.equals("max_anisotropy")){
        int amount = scan.nextInt();
        texture.setAnisotropicFilter(amount);
    }else{
        logger.log(Level.WARNING, "Unsupported texture_unit directive: {0}", keyword);
        readString("\n");
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:27,代码来源:MaterialLoader.java

示例4: initMaterials

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
/** Initialize the materials used in this scene. */
public void initMaterials() {
  wall_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  TextureKey key = new TextureKey("Textures/Terrain/BrickWall/BrickWall.jpg");
  key.setGenerateMips(true);
  Texture tex = assetManager.loadTexture(key);
  wall_mat.setTexture("ColorMap", tex);
 
  stone_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  TextureKey key2 = new TextureKey("Textures/Terrain/Rock/Rock.PNG");
  key2.setGenerateMips(true);
  Texture tex2 = assetManager.loadTexture(key2);
  stone_mat.setTexture("ColorMap", tex2);
 
  floor_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  TextureKey key3 = new TextureKey("Textures/Terrain/Pond/Pond.jpg");
  key3.setGenerateMips(true);
  Texture tex3 = assetManager.loadTexture(key3);
  tex3.setWrap(WrapMode.Repeat);
  floor_mat.setTexture("ColorMap", tex3);
}
 
开发者ID:devinbost,项目名称:jMathGame3d,代码行数:22,代码来源:Main.java

示例5: getMaterial

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
public Material getMaterial() {
	AssetManager assetManager = HexScapeCore.getInstance().getHexScapeJme3Application().getAssetManager();
	Material mat = new Material(assetManager, 
			"Common/MatDefs/Light/Lighting.j3md");
	
	Texture TileTexture = assetManager.loadTexture(getTextureFile(mainObjectName, name).getPath());
	TileTexture.setWrap(WrapMode.Repeat);
	mat.setTexture("DiffuseMap", TileTexture);
	mat.setBoolean("UseMaterialColors",true);    
	mat.setColor("Ambient", ColorRGBA.White.mult(0.5f));
	mat.setColor("Diffuse",ColorRGBA.White);  // minimum material color
       mat.setColor("Specular",ColorRGBA.White); // for shininess
       mat.setFloat("Shininess", 50f);
	
	return mat;
}
 
开发者ID:lyrgard,项目名称:HexScape,代码行数:17,代码来源:AseModelLoader.java

示例6: setUpMap

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
private void setUpMap() {
    Material floor_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");


    key3.setGenerateMips(true);

    Texture tex3 = assetManager.loadTexture(key3);
    tex3.setWrap(WrapMode.Repeat);
    floor_mat.setTexture("ColorMap", tex3);

    Box floor = new Box(MAP_WIDTH * PLACE_HOLDER, 1f, MAP_HEIGHT * PLACE_HOLDER);
    floor.scaleTextureCoordinates(new Vector2f(MAP_HEIGHT, MAP_WIDTH));

    floor_geo = new Geometry("Floor", floor);
    floor_geo.setMaterial(floor_mat);
    rootNode.attachChild(floor_geo);
    /* Make the floor physical with mass 0.0f! */
    RigidBodyControl floor_phy = new RigidBodyControl(0.0f);
    floor_geo.addControl(floor_phy);
    floor_phy.setPhysicsLocation(new Vector3f(0, -1f, 0));
    floor_geo.getControl(RigidBodyControl.class).setFriction(.5f);
    bullet.getPhysicsSpace().add(floor_geo);
}
 
开发者ID:damhonglinh,项目名称:Fruity-Bang,代码行数:24,代码来源:Scene.java

示例7: setUpMap

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
private void setUpMap() {
    Material floor_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key3 = new TextureKey("Textures/ground.png");

    key3.setGenerateMips(true);

    Texture tex3 = assetManager.loadTexture(key3);
    tex3.setWrap(WrapMode.Repeat);
    floor_mat.setTexture("ColorMap", tex3);

    Box floor = new Box(20f, 0.0f, 20f);
    floor.scaleTextureCoordinates(new Vector2f(20, 20));

    Geometry floor_geo = new Geometry("Floor", floor);
    floor_geo.setMaterial(floor_mat);
    pivot.attachChild(floor_geo);
    /* Make the floor physical with mass 0.0f! */
    RigidBodyControl floor_phy = new RigidBodyControl(0.0f);
    floor_geo.addControl(floor_phy);
    floor_phy.setPhysicsLocation(new Vector3f(0, 0, 0));
    bullet.getPhysicsSpace().add(floor_geo);
}
 
开发者ID:damhonglinh,项目名称:Fruity-Bang,代码行数:23,代码来源:Home.java

示例8: initMaterials

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
/** Initialize the materials used in this scene. */
public void initMaterials() {
  wall_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  TextureKey key = new TextureKey("Textures/Terrain/BrickWall/BrickWall.jpg");
  key.setGenerateMips(true);
  Texture tex = assetManager.loadTexture(key);
  wall_mat.setTexture("ColorMap", tex);

  stone_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  TextureKey key2 = new TextureKey("Textures/Terrain/Rock/Rock.PNG");
  key2.setGenerateMips(true);
  Texture tex2 = assetManager.loadTexture(key2);
  stone_mat.setTexture("ColorMap", tex2);

  floor_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  TextureKey key3 = new TextureKey("Textures/Terrain/Pond/Pond.jpg");
  key3.setGenerateMips(true);
  Texture tex3 = assetManager.loadTexture(key3);
  tex3.setWrap(WrapMode.Repeat);
  floor_mat.setTexture("ColorMap", tex3);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:22,代码来源:HelloPhysics.java

示例9: setupFloor

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
public void setupFloor(){
    Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
    mat.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
    mat.getTextureParam("NormalMap").getTextureValue().setWrap(WrapMode.Repeat);
   // mat.getTextureParam("ParallaxMap").getTextureValue().setWrap(WrapMode.Repeat);
    mat.setFloat("Shininess",3);
  //  mat.setBoolean("VertexLighting", true);
    
    
    Box floor = new Box(Vector3f.ZERO, 50, 1f, 50);
    TangentBinormalGenerator.generate(floor);
    floor.scaleTextureCoordinates(new Vector2f(5, 5));
    Geometry floorGeom = new Geometry("Floor", floor);
    floorGeom.setMaterial(mat);
    floorGeom.setShadowMode(ShadowMode.Receive);
    rootNode.attachChild(floorGeom);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:18,代码来源:TestSpotLight.java

示例10: initMaterial

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
public void initMaterial() {
    mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key = new TextureKey("Textures/Terrain/BrickWall/BrickWall.jpg");
    key.setGenerateMips(true);
    Texture tex = assetManager.loadTexture(key);
    mat.setTexture("ColorMap", tex);

    mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key2 = new TextureKey("Textures/Terrain/Rock/Rock.PNG");
    key2.setGenerateMips(true);
    Texture tex2 = assetManager.loadTexture(key2);
    mat2.setTexture("ColorMap", tex2);

    mat3 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key3 = new TextureKey("Textures/Terrain/Pond/Pond.jpg");
    key3.setGenerateMips(true);
    Texture tex3 = assetManager.loadTexture(key3);
    tex3.setWrap(WrapMode.Repeat);
    mat3.setTexture("ColorMap", tex3);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:21,代码来源:TestBrickWall.java

示例11: setupFloor

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
public void setupFloor() {
    mat = assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall2.j3m");
    mat.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
    mat.getTextureParam("NormalMap").getTextureValue().setWrap(WrapMode.Repeat);
    mat.setFloat("Shininess", 0);

    Node floorGeom = (Node) assetManager.loadAsset("Models/WaterTest/WaterTest.mesh.xml");
    Geometry g = ((Geometry) floorGeom.getChild(0));
    g.getMesh().scaleTextureCoordinates(new Vector2f(10, 10));
    TangentBinormalGenerator.generate(floorGeom);
    floorGeom.setLocalTranslation(0, 22, 0);
    floorGeom.setLocalScale(100);

    floorGeom.setMaterial(mat);        
    rootNode.attachChild(floorGeom);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:17,代码来源:TestParallax.java

示例12: doSetDiffuseTexture

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
private void doSetDiffuseTexture(int layer, String texturePath) {
    if (texturePath == null || texturePath.equals(""))
        texturePath = DEFAULT_TERRAIN_TEXTURE;

    Texture tex = SceneApplication.getApplication().getAssetManager().loadTexture(texturePath);
    tex.setWrap(WrapMode.Repeat);
    Terrain terrain = (Terrain) getTerrain(null);
    
    if (layer == 0)
        terrain.getMaterial().setTexture("DiffuseMap", tex);
    else
        terrain.getMaterial().setTexture("DiffuseMap_"+layer, tex);

    doSetTextureScale(layer, DEFAULT_TEXTURE_SCALE);
    
    setNeedsSave(true);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:18,代码来源:TerrainEditorController.java

示例13: doSetNormalMap

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
private void doSetNormalMap(int layer, String texturePath) {
    Terrain terrain = (Terrain) getTerrain(null);
    if (terrain == null)
        return;

    if (texturePath == null) {
        // remove the texture if it is null
        if (layer == 0)
            terrain.getMaterial().clearParam("NormalMap");
        else
            terrain.getMaterial().clearParam("NormalMap_"+layer);
    } else {
        Texture tex = SceneApplication.getApplication().getAssetManager().loadTexture(texturePath);
        tex.setWrap(WrapMode.Repeat);

        if (layer == 0)
            terrain.getMaterial().setTexture("NormalMap", tex);
        else
            terrain.getMaterial().setTexture("NormalMap_"+layer, tex);
    }
    enableTextureButtons();
    setNeedsSave(true);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:24,代码来源:TerrainEditorController.java

示例14: BlockMaterial

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
public BlockMaterial(
		Block block,
		AssetManager assetManager,
		JmeResourceManager resourceManager) {
	super(assetManager, getShader(block.getBlockType()));
	
	if (block.getColor() != null) {
		Color blockColor = block.getColor();
		
		color.x = (float)blockColor.red;
		color.y = (float)blockColor.green;
		color.z = (float)blockColor.blue;
		color.w = (float)blockColor.alpha;
		
		setInt("ColorBlendMode", ShaderUtil.getColorBlendModeAsInteger(ColorBlendMode.NORMAL));
	} else {
		setInt("ColorBlendMode", ShaderUtil.COLOR_BLEND_MODE_INVALID);
	}
	
	setVector4("Color", color);
	
	if (block.getTexture() != null) {
		texture = resourceManager.loadTexture(block.getName(), block.getTexture().getAsResource(resourceManager));
	} else {
		texture = assetManager.loadTexture("/assets/images/white-pixel.png");
	}
	
	texture.setMagFilter(MagFilter.Nearest);
	texture.setMinFilter(MinFilter.NearestNoMipMaps);
	texture.setWrap(WrapMode.Repeat);
	
	setTexture("ColorMap", texture);
	
	getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:36,代码来源:BlockMaterial.java

示例15: setupFloor

import com.jme3.texture.Texture.WrapMode; //导入依赖的package包/类
public void setupFloor() {
    Material mat = assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall.j3m");
    mat.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
    mat.getTextureParam("NormalMap").getTextureValue().setWrap(WrapMode.Repeat);
    mat.getTextureParam("ParallaxMap").getTextureValue().setWrap(WrapMode.Repeat);
    Box floor = new Box(Vector3f.ZERO, 50, 1f, 50);
    TangentBinormalGenerator.generate(floor);
    floor.scaleTextureCoordinates(new Vector2f(5, 5));
    Geometry floorGeom = new Geometry("Floor", floor);
    floorGeom.setMaterial(mat);
    floorGeom.setShadowMode(ShadowMode.Receive);
    rootNode.attachChild(floorGeom);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:TestPostFilters.java


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