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


Java GL2.glColor4d方法代碼示例

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


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

示例1: drawLine

import javax.media.opengl.GL2; //導入方法依賴的package包/類
protected void drawLine(DrawContext dc, Vec4 screenPoint, Vec4 projectedPoint, DetailedOrderedIcon uIcon) {
	//GL gl = dc.getGL();
	GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.
	
	gl.glLoadIdentity();
	
	double opacity = uIcon.getOpacity();
	
	opacity = Math.min(opacity, .5f);
	
	gl.glDisable(GL.GL_TEXTURE_2D);
	gl.glColor4d(.2,.2,.2, opacity);
	
	gl.glBegin(GL.GL_LINES);
		gl.glVertex2d(screenPoint.x, screenPoint.y);
		gl.glVertex2d(projectedPoint.x, projectedPoint.y);
	gl.glEnd();
	gl.glEnable(GL.GL_TEXTURE_2D);
	
	gl.glColor4f(1,1,1,1);
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:22,代碼來源:DetailedIconRenderer.java

示例2: renderPatchBoundary

import javax.media.opengl.GL2; //導入方法依賴的package包/類
protected void renderPatchBoundary(DrawContext dc, RectTile tile)
{
   // GL gl = dc.getGL();
	GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.
    OGLStackHandler ogsh = new OGLStackHandler();

    ogsh.pushAttrib(gl, GL2.GL_ENABLE_BIT | GL2.GL_CURRENT_BIT | GL2.GL_POLYGON_BIT);
    try
    {
        gl.glDisable(GL.GL_BLEND);

        // Don't perform depth clipping but turn on backface culling
        gl.glDisable(GL.GL_DEPTH_TEST);
        gl.glEnable(GL.GL_CULL_FACE);
        gl.glCullFace(GL.GL_BACK);
        gl.glPolygonMode(GL.GL_FRONT, GL2.GL_LINE);

        Vec4[] corners = tile.sector.computeCornerPoints(dc.getGlobe(), dc.getVerticalExaggeration());

        gl.glColor4d(1d, 0, 0, 1d);
        gl.glBegin(javax.media.opengl.GL2.GL_QUADS);
        gl.glVertex3d(corners[0].x, corners[0].y, corners[0].z);
        gl.glVertex3d(corners[1].x, corners[1].y, corners[1].z);
        gl.glVertex3d(corners[2].x, corners[2].y, corners[2].z);
        gl.glVertex3d(corners[3].x, corners[3].y, corners[3].z);
        gl.glEnd();
    }
    finally
    {
        ogsh.pop(gl);
    }
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:33,代碼來源:MYEBSRectangularTessellator.java

示例3: setBlendingFunction

import javax.media.opengl.GL2; //導入方法依賴的package包/類
protected void setBlendingFunction(DrawContext dc)
{
	// Set up a premultiplied-alpha blending function. Any texture read by JOGL will have alpha-premultiplied color
	// components, as will any DDS file created by World Wind or the World Wind WMS. We'll also set up the base
	// color as a premultiplied color, so that any incoming premultiplied color will be properly combined with the
	// base color.

	//GL gl = dc.getGL();
	GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.

	double alpha = this.getOpacity();
	gl.glColor4d(alpha, alpha, alpha, alpha);
	gl.glEnable(GL.GL_BLEND);
	gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:16,代碼來源:ScalingTiledImageLayer.java

示例4: draw

import javax.media.opengl.GL2; //導入方法依賴的package包/類
protected void draw(DrawContext dc)
{
    this.referencePoint = this.computeReferencePoint(dc);

    Position pos = dc.getView().getEyePosition();
    this.centerPoint = new LatLon(pos.getLatitude(), pos.getLongitude());
    
    this.assembleTiles(dc); // Determine the tiles to draw.

    if (this.currentTiles.size() >= 1)
    {
        TextureTile[] sortedTiles = new TextureTile[this.currentTiles.size()];
        sortedTiles = this.currentTiles.toArray(sortedTiles);
        Arrays.sort(sortedTiles, levelComparer);

        //GL gl = dc.getGL();
        GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.

        if (this.isUseTransparentTextures() || this.getOpacity() < 1)
        {
            gl.glPushAttrib(GL.GL_COLOR_BUFFER_BIT | GL2.GL_POLYGON_BIT | GL2.GL_CURRENT_BIT);
            gl.glColor4d(1d, 1d, 1d, this.getOpacity());
            gl.glEnable(GL.GL_BLEND);
            gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
        }
        else
        {
            gl.glPushAttrib(GL.GL_COLOR_BUFFER_BIT | GL2.GL_POLYGON_BIT);
        }

        gl.glPolygonMode(GL.GL_FRONT, GL2.GL_FILL);
        gl.glEnable(GL.GL_CULL_FACE);
        gl.glCullFace(GL.GL_BACK);

        dc.setPerFrameStatistic(PerformanceStatistic.IMAGE_TILE_COUNT, this.tileCountName,
            this.currentTiles.size());
        dc.getGeographicSurfaceTileRenderer().renderTiles(dc, this.currentTiles);

        gl.glPopAttrib();

        if (this.drawTileIDs)
            this.drawTileIDs(dc, this.currentTiles);

        if (this.drawBoundingVolumes)
            this.drawBoundingVolumes(dc, this.currentTiles);

        this.currentTiles.clear();
    }

    this.sendRequests();
    this.requestQ.clear();
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:53,代碼來源:DynamicImageTileLayer.java


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