本文整理汇总了Java中com.jme.image.Texture2D类的典型用法代码示例。如果您正苦于以下问题:Java Texture2D类的具体用法?Java Texture2D怎么用?Java Texture2D使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Texture2D类属于com.jme.image包,在下文中一共展示了Texture2D类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CaptureQuad
import com.jme.image.Texture2D; //导入依赖的package包/类
public CaptureQuad(String name, int camWidth, int camHeight, float frameRate) {
super(name);
try {
image = new QtCaptureImage();
image.initializeCamera(camWidth, camHeight, frameRate);
tex = new Texture2D();
tex.setMinificationFilter(MinificationFilter.Trilinear);
tex.setMagnificationFilter(MagnificationFilter.Bilinear);
tex.setImage(image);
tex.setApply(ApplyMode.Replace);
TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
ts.setEnabled(true);
ts.setTexture(tex);
setRenderState(ts);
updateRenderState();
} catch (Exception e) {
e.printStackTrace();
}
start();
// could, at this point, resize to fit height to current width?
}
示例2: loadVideo
import com.jme.image.Texture2D; //导入依赖的package包/类
private void loadVideo(URL videoResource) {
try {
image = new JMFVideoImage(videoResource, true, JMFVideoImage.SCALE_MAXIMIZE);
tex = new Texture2D();
tex.setMinificationFilter(MinificationFilter.Trilinear);
tex.setMagnificationFilter(MagnificationFilter.Bilinear);
tex.setImage(image);
tex.setApply(ApplyMode.Replace);
TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
ts.setEnabled(true);
ts.setTexture(tex);
setRenderState(ts);
updateRenderState();
} catch (Exception e) {
e.printStackTrace();
}
start();
// could, at this point, resize to fit height to current width?
}
示例3: SGChangeGeometryTextureSet
import com.jme.image.Texture2D; //导入依赖的package包/类
private SGChangeGeometryTextureSet (GeometryNode geometryNode, Texture2D texture,
DrawingSurface surface) {
super(SGChangeOp.GEOMETRY_TEXTURE_SET);
this.geometryNode = geometryNode;
this.texture = texture;
this.surface = surface;
}
示例4: setTexture
import com.jme.image.Texture2D; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void setTexture(Texture2D texture) {
super.setTexture(texture);
quad.setTexture(texture);
logger.fine("Last texture assigned to quad = " + texture);
}
示例5: sgChangeGeometryTextureSet
import com.jme.image.Texture2D; //导入依赖的package包/类
private synchronized void sgChangeGeometryTextureSet(GeometryNode geometryNode, Texture2D texture,
DrawingSurface surface) {
sgChanges.add(new SGChangeGeometryTextureSet(geometryNode, texture, surface));
}
示例6: RobotCamera
import com.jme.image.Texture2D; //导入依赖的package包/类
/**
* creates the missile cam.
* @param x position of the total area of the display in ortho values
* @param y position of the total area of the display in ortho values
* @param width width of the environment display in ortho values
* @param height height of the environment display in ortho values
*/
public RobotCamera(final float x, final float y, final float width, final float height) {
//public RobotCamera(final float x, final float y) {
createNoiseTextureState();
tRenderer = disp.createTextureRenderer(
240, 180, TextureRenderer.Target.Texture2D);
// 60, 50, TextureRenderer.Target.Texture2D);
robotCamNode = new CameraNode("Robot Camera Node", tRenderer.getCamera());
//tRenderer.getCamera().setFrustumFar(100000);
// tRenderer.getCamera().setFrustum(1.0f, 100000.0f, -0.55f, 1f, 0.4125f, -0.4125f);
//tRenderer.getCamera().resize(240, 180);
tRenderer.getCamera().setFrustumPerspective(45.0f,(float) width / (float) height, 1, 1000);
tRenderer.getCamera().update();
robotCamNode.setLocalTranslation(new Vector3f(0, 2.5f, -10));
robotCamNode.updateGeometricState(0, true);
robotCamNode.updateWorldData(0);
monitorNode = new Node("Monitor Node");
monitorQuad = new Quad("Monitor");
monitorQuad.initialize(240, 180);
monitorQuad.setLocalTranslation(x, y, 0);
monitorQuad.setIsCollidable(true);
Quad quad2 = new Quad("Monitor");
quad2.initialize(250, 190);
quad2.setLocalTranslation(x, y, 0);
monitorNode.attachChild(quad2);
monitorNode.attachChild(monitorQuad);
// Ok, now lets create the Texture object that our scene will be rendered to.
tRenderer.setBackgroundColor(new ColorRGBA(0f, 0f, 0f, 1f));
fakeTex = new Texture2D();
fakeTex.setRenderToTextureType(Texture.RenderToTextureType.RGBA);
tRenderer.setupTexture(fakeTex);
screenTextureState = disp.getRenderer().createTextureState();
screenTextureState.setTexture(fakeTex);
screenTextureState.setEnabled(true);
monitorQuad.setRenderState(screenTextureState);
monitorNode.updateGeometricState(0.0f, true);
monitorNode.updateRenderState();
monitorNode.setLightCombineMode(LightCombineMode.Off);
}
示例7: getTexture
import com.jme.image.Texture2D; //导入依赖的package包/类
/**
* Return the texture containing the window contents.
* Note: mostly used only for share-aware apps.
*/
public Texture2D getTexture() {
return texture;
}
示例8: setTexture
import com.jme.image.Texture2D; //导入依赖的package包/类
/**
* Specify the texture to be displayed. In your subclass method you should make your geometry display
* this texture. Must be called in a render loop safe way.
*/
public void setTexture(Texture2D texture) {
this.texture = texture;
}