• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java GLUgl2类的典型用法和代码示例

java 4次浏览

本文整理汇总了Java中javax.media.opengl.glu.gl2.GLUgl2的典型用法代码示例。如果您正苦于以下问题:Java GLUgl2类的具体用法?Java GLUgl2怎么用?Java GLUgl2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

GLUgl2类属于javax.media.opengl.glu.gl2包,在下文中一共展示了GLUgl2类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: drawNurbSurface

点赞 3

import javax.media.opengl.glu.gl2.GLUgl2; //导入依赖的package包/类
private void drawNurbSurface(GLAutoDrawable drawable) {
	GL2 gl = drawable.getGL().getGL2();
	gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);

	GLUgl2 glug12 = new GLUgl2();
	GLUnurbs nurbsRenderer = glug12.gluNewNurbsRenderer();
	//glug12.gluNurbsProperty(nurbsRenderer, , arg2)
	glug12.gluBeginSurface(nurbsRenderer);
	int uknot_cnt=8;
	float[] uknot = new float[] {0.f, 0.f, 0.f, 0.f, 1.f, 1.f, 1.f, 1.f};
	int vknot_cnt = 8;
	float[] vknot = uknot;
	int ustride=4*3;
	int vstride=3;
	int uorder=4;
	int vorder=4;
	int evl_type=GL2.GL_MAP2_NORMAL;
	//glug12.gluNurbsSurface(nurbsRenderer, uknot_cnt, uknot, vknot_cnt, vknot, ustride, vstride, ctlarray, uorder, vorder, evl_type);
	evl_type=GL2.GL_MAP2_VERTEX_3;
	glug12.gluNurbsSurface(nurbsRenderer, uknot_cnt, uknot, vknot_cnt, vknot, ustride, vstride, ctlarray, uorder, vorder, evl_type);
	glug12.gluEndSurface(nurbsRenderer);
}
 

开发者ID:akmaier,
项目名称:CONRAD,
代码行数:23,
代码来源:SurfaceTest.java

示例2: Create

点赞 2

import javax.media.opengl.glu.gl2.GLUgl2; //导入依赖的package包/类
public void Create (GL2 gl)
{
	int[] arr = new int[1];
	gl.glGenTextures(1, arr, 0);
	id = arr[0];
	GLUgl2 glu = new GLUgl2();

	gl.glBindTexture(GL.GL_TEXTURE_2D, id);
	gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 4);
	//gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);
	gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_MODULATE);

	/*
	 * New fancy way of doing it - might not work
	 * gl.glTexStorage2D(GL.GL_TEXTURE_2D, 10, GL.GL_RGBA, width, height);
	 * gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, 0, 0, width, height,
	 * GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, img); gl.glEnable(GL.GL_TEXTURE_2D);
	 * gl.glGenerateMipmap(GL.GL_TEXTURE_2D);
	 * gl.glDisable(GL.GL_TEXTURE_2D);
	 */

	// Old ugly way of doing it
	glu.gluBuild2DMipmaps(GL.GL_TEXTURE_2D, GL.GL_RGBA, width, height, GL.GL_RGBA,
			GL.GL_UNSIGNED_BYTE, img);

	gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP);
	gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP);
	gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR);
	gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR);
}
 

开发者ID:ryft,
项目名称:NetVis,
代码行数:31,
代码来源:Texture.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)