當前位置: 首頁>>代碼示例>>Java>>正文


Java AABBox.getHeight方法代碼示例

本文整理匯總了Java中com.jogamp.opengl.math.geom.AABBox.getHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java AABBox.getHeight方法的具體用法?Java AABBox.getHeight怎麽用?Java AABBox.getHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.jogamp.opengl.math.geom.AABBox的用法示例。


在下文中一共展示了AABBox.getHeight方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDebugOutline

import com.jogamp.opengl.math.geom.AABBox; //導入方法依賴的package包/類
protected OutlineShape createDebugOutline(final OutlineShape shape, final AABBox box) {
    final float tw = box.getWidth();
    final float th = box.getHeight();

    final float minX = box.getMinX();
    final float minY = box.getMinY();
    final float z = box.getMinZ() + 0.025f;

    // CCW!
    shape.addVertex(minX,    minY,      z, true);
    shape.addVertex(minX+tw, minY,      z, true);
    shape.addVertex(minX+tw, minY + th, z, true);
    shape.addVertex(minX,    minY + th, z, true);
    shape.closeLastOutline(true);

    return shape;
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:18,代碼來源:UIShape.java

示例2: renderString

import com.jogamp.opengl.math.geom.AABBox; //導入方法依賴的package包/類
void renderString(final GLDrawable drawable, final GL2ES2 gl, final RegionRenderer renderer, final Font font, final TextRegionUtil textRenderUtil, final String text, final int column, int row, final int z0, final int[] sampleCount) {
    final int height = drawable.getSurfaceHeight();

    int dx = 0;
    int dy = height;
    if(0>row) {
        row = lastRow + 1;
    }
    final AABBox textBox = font.getMetricBounds(text, fontSize);
    dx += font.getAdvanceWidth('X', fontSize) * column;
    dy -= (int)textBox.getHeight() * ( row + 1 );

    final PMVMatrix pmv = renderer.getMatrix();
    pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
    pmv.glLoadIdentity();
    pmv.glTranslatef(dx, dy, z0);
    textRenderUtil.drawString3D(gl, renderer, font, fontSize, text, null, sampleCount);

    lastRow = row;
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:21,代碼來源:TestTextRendererNEWTBugXXXX.java

示例3: renderString

import com.jogamp.opengl.math.geom.AABBox; //導入方法依賴的package包/類
void renderString(final GLDrawable drawable, final GL2ES2 gl, final RegionRenderer renderer, final TextRegionUtil textRenderUtil, final String text, final int column, int row, final int z0, final int[] sampleCount) {
    final int height = drawable.getSurfaceHeight();

    int dx = 0;
    int dy = height;
    if(0>row) {
        row = lastRow + 1;
    }
    final AABBox textBox = font.getMetricBounds(text, fontSize);
    dx += font.getAdvanceWidth('X', fontSize) * column;
    dy -= (int)textBox.getHeight() * ( row + 1 );

    final PMVMatrix pmv = renderer.getMatrix();
    pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
    pmv.glLoadIdentity();
    pmv.glTranslatef(dx, dy, z0);
    textRenderUtil.drawString3D(gl, renderer, font, fontSize, text, null, sampleCount);

    lastRow = row;
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:21,代碼來源:TestTextRendererNEWT10.java

示例4: addShapeToRegion

import com.jogamp.opengl.math.geom.AABBox; //導入方法依賴的package包/類
@Override
protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) {
    final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory());
    if(corner == 0.0f) {
        createSharpOutline(shape, DEFAULT_2PASS_LABEL_ZOFFSET);
    } else {
        createCurvedOutline(shape, DEFAULT_2PASS_LABEL_ZOFFSET);
    }
    shape.setIsQuadraticNurbs();
    shape.setSharpness(shapesSharpness);
    region.addOutlineShape(shape, null, rgbaColor);
    box.resize(shape.getBounds());

    // Precompute text-box size .. guessing pixelSize
    final float lPixelSize0 = 10f;
    final float lw = width * ( 1f - spacingX ) ;
    final float lh = height * ( 1f - spacingY ) ;
    final AABBox lbox0 = label.font.getMetricBounds(label.text, lPixelSize0);
    final float lsx = lw / lbox0.getWidth();
    final float lsy = lh / lbox0.getHeight();
    final float lPixelSize1 = lsx < lsy ? lPixelSize0 * lsx : lPixelSize0 * lsy;
    if( DRAW_DEBUG_BOX ) {
        System.err.println("RIButton: spacing "+spacingX+", "+spacingY);
        System.err.println("RIButton: bbox "+box);
        System.err.println("RIButton: lbox "+lbox0+", "+label.text);
        System.err.println("RIButton: net-text "+lw+" x "+lh);
        System.err.println("RIButton: lsx "+lsx+", lsy "+lsy+": pixelSize "+lPixelSize0+" -> "+lPixelSize1);
    }

    // Setting pixelSize based on actual text-box size
    final AABBox lbox1 = label.font.getPointsBounds(null, label.text, lPixelSize1, tempT1, tempT2);
    // Center text .. (share same center w/ button)
    final float[] lctr = lbox1.getCenter();
    final float[] ctr = box.getCenter();
    final float[] ltx = new float[] { ctr[0] - lctr[0], ctr[1] - lctr[1], 0f };

    final AABBox lbox2 = label.addShapeToRegion(lPixelSize1, region, tempT1.setToTranslation(ltx[0], ltx[1]));
    if( DRAW_DEBUG_BOX ) {
        System.err.printf("RIButton.0: lbox1 %s%n", lbox1);
        System.err.printf("RIButton.0: lbox2 %s%n", lbox2);
    }

    setRotationOrigin( ctr[0], ctr[1], ctr[2]);

    if( DRAW_DEBUG_BOX ) {
        System.err.println("XXX.UIShape.RIButton: Added Shape: "+shape+", "+box);
    }
}
 
開發者ID:java-opengl-labs,項目名稱:jogl-samples,代碼行數:49,代碼來源:LabelButton.java


注:本文中的com.jogamp.opengl.math.geom.AABBox.getHeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。