本文整理匯總了Java中javax.media.opengl.GL.glVertex3dv方法的典型用法代碼示例。如果您正苦於以下問題:Java GL.glVertex3dv方法的具體用法?Java GL.glVertex3dv怎麽用?Java GL.glVertex3dv使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.media.opengl.GL
的用法示例。
在下文中一共展示了GL.glVertex3dv方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawFaceForDebug
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void drawFaceForDebug(GL gl){
for(CSG_Polygon poly : polygons){
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_INSIDE){ // red
gl.glColor4d(0.9, 0.4, 0.4, 0.5);
}
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_OUTSIDE){ // green
gl.glColor4d(0.4, 0.9, 0.4, 0.5);
}
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_OPPOSITE){ // blue
gl.glColor4d(0.4, 0.4, 0.9, 0.5);
}
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_SAME){ // purple
gl.glColor4d(0.8, 0.4, 0.8, 0.5);
}
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_UNKNOWN){ // gray
gl.glColor4d(0.5, 0.5, 0.5, 0.5);
}
Iterator<CSG_Vertex> iterV = poly.getVertexIterator();
gl.glBegin(GL.GL_POLYGON);
while(iterV.hasNext()){
gl.glVertex3dv(iterV.next().getXYZ(), 0);
}
gl.glEnd();
}
}
示例2: drawFaceLinesForDebug
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void drawFaceLinesForDebug(GL gl){
for(CSG_Polygon poly : polygons){
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_INSIDE){ // red
gl.glColor3d(0.5, 0.2, 0.2);
}
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_OUTSIDE){ // green
gl.glColor3d(0.2, 0.5, 0.2);
}
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_OPPOSITE){ // blue
gl.glColor3d(0.2, 0.2, 0.5);
}
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_SAME){ // purple
gl.glColor3d(0.5, 0.2, 0.5);
}
if(poly.type == CSG_Polygon.POLY_TYPE.POLY_UNKNOWN){ // gray
gl.glColor3d(0.25, 0.25, 0.25);
}
Iterator<CSG_Vertex> iterV = poly.getVertexIterator();
gl.glBegin(GL.GL_LINE_LOOP);
while(iterV.hasNext()){
gl.glVertex3dv(iterV.next().getXYZ(), 0);
}
gl.glEnd();
}
}
示例3: glDrawImportantEdges
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void glDrawImportantEdges(GL gl){
/*
if(this.isSelectable()){
// draw perimeter if face is selectable.. :)
//gl.glColor3d(0.25, 0.25, 0.25);
Iterator<CSG_Vertex> iterPerim = this.getPerimeterVertices().iterator();
gl.glBegin(GL.GL_LINE_LOOP);
while(iterPerim.hasNext()){
CSG_Vertex v = iterPerim.next();
gl.glTexCoord3dv(v.getXYZ(), 0); // must call before you place the vertex! :)
gl.glVertex3dv(v.getXYZ(), 0);
}
gl.glEnd();
}
*/
// alternatively, just draw the mating edge lines
gl.glBegin(GL.GL_LINES);
for(CSG_Vertex v : matingEdgeLines){
gl.glTexCoord3dv(v.getXYZ(), 0); // must call before you place the vertex! :)
gl.glVertex3dv(v.getXYZ(), 0);
}
gl.glEnd();
}
示例4: drawFaceWireframe
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void drawFaceWireframe(GL gl){
for(CSG_Polygon poly : polygons){
Iterator<CSG_Vertex> iterV = poly.getVertexIterator();
gl.glBegin(GL.GL_LINE_LOOP);
while(iterV.hasNext()){
gl.glVertex3dv(iterV.next().getXYZ(), 0);
}
gl.glEnd();
}
}
示例5: drawNormalFromOriginForDegug
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void drawNormalFromOriginForDegug(GL gl){
gl.glColor3d(1.0, 0.0, 0.0);
double scale = 1.0;
gl.glBegin(GL.GL_LINES);
gl.glVertex3dv(normal.getScaledCopy(scale).getXYZ(), 0);
gl.glVertex3d(0.0, 0.0, 0.0);
gl.glEnd();
}
示例6: glDrawPolygon
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void glDrawPolygon(GL gl){
// TODO: put this in a GL lib of somekind..
gl.glBegin(GL.GL_POLYGON);
for(CSG_Vertex v : vertices){
gl.glVertex3dv(v.getXYZ(), 0);
}
gl.glEnd();
}
示例7: drawPolygonForDebug
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void drawPolygonForDebug(GL gl){
gl.glColor3f(0.5f, 0.7f, 0.7f);
gl.glBegin(GL.GL_POLYGON);
for(CSG_Vertex v : vertices){
gl.glVertex3dv(v.getXYZ(), 0);
}
gl.glEnd();
}
示例8: drawPolygonNormalsForDebug
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void drawPolygonNormalsForDebug(GL gl){
float[] currentColor=new float[]{0,0,0,0};
gl.glGetFloatv(GL.GL_CURRENT_COLOR, currentColor, 0);
gl.glColor3d(1.0, 0.0, 0.0);
CSG_Vertex fCenter = getBarycenterVertex();
CSG_Vertex norm = getPlane().getNormal();
double scale = 10;
fCenter.addToVertex(norm.getScaledCopy(scale));
CSG_Vertex nShifted = fCenter.addToVertex(norm.getScaledCopy(scale));
gl.glBegin(GL.GL_LINES);
gl.glVertex3dv(fCenter.getXYZ(), 0);
gl.glVertex3dv(nShifted.getXYZ(), 0);
gl.glEnd();
gl.glColor3d(currentColor[0], currentColor[1], currentColor[2]);
}
示例9: drawPlaneForDebug
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void drawPlaneForDebug(GL gl){
// 3x5 rectangle (aligned along var 1);
CSG_Vertex a = origin.addToVertex(xAxis.getScaledCopy( 2.5)).addToVertex(yAxis.getScaledCopy( 1.5));
CSG_Vertex b = origin.addToVertex(xAxis.getScaledCopy(-2.5)).addToVertex(yAxis.getScaledCopy( 1.5));
CSG_Vertex c = origin.addToVertex(xAxis.getScaledCopy(-2.5)).addToVertex(yAxis.getScaledCopy(-1.5));
CSG_Vertex d = origin.addToVertex(xAxis.getScaledCopy( 2.5)).addToVertex(yAxis.getScaledCopy(-1.5));
gl.glColor3f(0.5f, 1.0f, 1.0f);
gl.glBegin(GL.GL_LINE_LOOP);
gl.glVertex3dv(a.getXYZ(), 0);
gl.glVertex3dv(b.getXYZ(), 0);
gl.glVertex3dv(c.getXYZ(), 0);
gl.glVertex3dv(d.getXYZ(), 0);
gl.glEnd();
}
示例10: glDrawFace
import javax.media.opengl.GL; //導入方法依賴的package包/類
public void glDrawFace(GL gl){
if(AvoGlobal.DEBUG_MODE){
drawFaceForDebug(gl);
drawFaceLinesForDebug(gl);
drawFaceNormalsForDebug(gl);
}else{
// Main drawing routine.
for(CSG_Polygon poly : polygons){
/*
if(selectable && isSelected){
gl.glColor3d(0.4, 0.9, 0.7);
}else{
gl.glColor3d(0.4, 0.9, 0.4);
}
*/
Iterator<CSG_Vertex> iterV = poly.getVertexIterator();
gl.glBegin(GL.GL_POLYGON);
while(iterV.hasNext()){
CSG_Vertex v = iterV.next();
gl.glTexCoord3dv(v.getXYZ(), 0); // must call before you place the vertex! :)
gl.glNormal3fv(poly.getPlane().getNormal().toFloatArray(),0);
gl.glVertex3dv(v.getXYZ(), 0);
}
gl.glEnd();
}
/*
if(this.isSelectable()){
// draw perimeter if face is selectable.. :)
gl.glColor3d(0.25, 0.25, 0.25);
Iterator<CSG_Vertex> iterPerim = this.getPerimeterVertices().iterator();
gl.glBegin(GL.GL_LINE_LOOP);
while(iterPerim.hasNext()){
CSG_Vertex v = iterPerim.next();
gl.glTexCoord3dv(v.getXYZ(), 0); // must call before you place the vertex! :)
gl.glVertex3dv(v.getXYZ(), 0);
}
gl.glEnd();
}
*/
}
}