本文整理汇总了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);
}
示例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);
}
示例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");
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}