本文整理汇总了Java中com.jogamp.opengl.util.texture.TextureCoords.bottom方法的典型用法代码示例。如果您正苦于以下问题:Java TextureCoords.bottom方法的具体用法?Java TextureCoords.bottom怎么用?Java TextureCoords.bottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.util.texture.TextureCoords
的用法示例。
在下文中一共展示了TextureCoords.bottom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FloorModel
import com.jogamp.opengl.util.texture.TextureCoords; //导入方法依赖的package包/类
FloorModel(Texture t, Point3d p, DynamicsWorld world) {
super(p,1);
mkStaticGroundPlane(world);
if(floorInt == 0){
this.gl = gl;
this.t = t;
TextureCoords textureCoords = t.getImageTexCoords();
textureTop = textureCoords.top();
textureBottom = textureCoords.bottom();
textureLeft = textureCoords.left();
textureRight = textureCoords.right();
floorInt = genCibeList(world);
}
}
示例2: Wall
import com.jogamp.opengl.util.texture.TextureCoords; //导入方法依赖的package包/类
Wall(Point3d p, DynamicsWorld world) {
super(p, 1);
if(obj == 0){
try {
texture = Textures.wall;
TextureCoords textureCoords = texture.getImageTexCoords();
textureTop = textureCoords.top();
textureBottom = textureCoords.bottom();
textureLeft = textureCoords.left();
textureRight = textureCoords.right();
}catch (Exception e){
e.printStackTrace();
System.out.println("Error loading wall texture");
}
obj = genCube();
}
initializePhysics(world);
}
示例3: drawCorners
import com.jogamp.opengl.util.texture.TextureCoords; //导入方法依赖的package包/类
private void drawCorners(GL2 gl, Map<String, Vertex> map) {
Vertex rightBottom = map.get("rightBottom");
Vertex leftBottom = map.get("leftBottom");
Vertex rightTop = map.get("rightTop");
Vertex leftTop = map.get("leftTop");
TextureCoords textureCoords = texture.getImageTexCoords();
float leftTex = textureCoords.left();
float rightTex = textureCoords.right();
float topTex = textureCoords.top();
float bottomTex = textureCoords.bottom();
gl.glPushMatrix();
gl.glBegin(GL_TRIANGLE_STRIP);
gl.glTexCoord2d(rightTex, bottomTex);
gl.glVertex3f(rightBottom.getPositionX(), rightBottom.getPositionY(),
rightBottom.getPositionZ());
gl.glTexCoord2d(rightTex, topTex);
gl.glVertex3f(rightTop.getPositionX(), rightTop.getPositionY(), rightTop.getPositionZ());
gl.glTexCoord2d(leftTex, bottomTex);
gl.glVertex3f(leftBottom.getPositionX(), leftBottom.getPositionY(), leftBottom.getPositionZ());
gl.glTexCoord2d(leftTex, topTex);
gl.glVertex3f(leftTop.getPositionX(), leftTop.getPositionY(), leftTop.getPositionZ());
gl.glEnd();
gl.glPopMatrix();
}
示例4: renderTexture
import com.jogamp.opengl.util.texture.TextureCoords; //导入方法依赖的package包/类
/**
* Render a texture to the given position.
*
* @param texture Texture to draw
* @param centerX X coordinate for the center of the texture
* @param centerY Y coordinate for the center of the texture
*/
private void renderTexture(Texture texture, double centerX, double centerY) {
TextureCoords tc = texture.getImageTexCoords();
float tx1 = tc.left();
float ty1 = tc.top();
float tx2 = tc.right();
float ty2 = tc.bottom();
float halfWidth = quarterValue(texture.getWidth());
float halfHeight = quarterValue(texture.getHeight());
GL2 gl = scene.gl;
texture.bind(gl);
texture.enable(gl);
Color foreground = scene.getForegroundColor();
gl.glColor4f(foreground.getRed() / 255f,
foreground.getGreen() / 255f,
foreground.getBlue() / 255f,
foreground.getAlpha() / 255f);
gl.glPushMatrix();
float[] translate = GLScene.P((float) centerX, (float) centerY);
gl.glTranslatef(translate[0], translate[1], translate[2]);
gl.glBegin(GL2.GL_QUADS);
// divided by 2 to get nicer textures
// divided by 4 when we center it : 1/2 on each side of x axis for instance.
gl.glTexCoord2f(tx1, ty1);
GLScene.V(gl, -halfWidth, halfHeight);
gl.glTexCoord2f(tx2, ty1);
GLScene.V(gl, halfWidth, halfHeight);
gl.glTexCoord2f(tx2, ty2);
GLScene.V(gl, halfWidth, -halfHeight);
gl.glTexCoord2f(tx1, ty2);
GLScene.V(gl, -halfWidth, -halfHeight);
gl.glEnd();
gl.glPopMatrix();
texture.disable(gl);
}
示例5: drawGlyph
import com.jogamp.opengl.util.texture.TextureCoords; //导入方法依赖的package包/类
@Override
public final float drawGlyph(/*@Nonnull*/ final GL gl,
/*@Nonnull*/ final Glyph glyph,
/*@CheckForSigned*/ final float x,
/*@CheckForSigned*/ final float y,
/*@CheckForSigned*/ final float z,
/*@CheckForSigned*/ final float scale,
/*@Nonnull*/ final TextureCoords coords) {
Check.notNull(gl, "GL cannot be null");
Check.notNull(glyph, "Glyph cannot be null");
Check.notNull(coords, "Texture coordinates cannot be null");
// Compute position and size
quad.xl = x + (scale * glyph.kerning);
quad.xr = quad.xl + (scale * glyph.width);
quad.yb = y - (scale * glyph.descent);
quad.yt = quad.yb + (scale * glyph.height);
quad.z = z;
quad.sl = coords.left();
quad.sr = coords.right();
quad.tb = coords.bottom();
quad.tt = coords.top();
// Draw quad
pipeline.addQuad(gl, quad);
// Return distance to next character
return glyph.advance;
}