当前位置: 首页>>代码示例>>Java>>正文


Java Cylinder.draw方法代码示例

本文整理汇总了Java中org.lwjgl.util.glu.Cylinder.draw方法的典型用法代码示例。如果您正苦于以下问题:Java Cylinder.draw方法的具体用法?Java Cylinder.draw怎么用?Java Cylinder.draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.util.glu.Cylinder的用法示例。


在下文中一共展示了Cylinder.draw方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawCylinder

import org.lwjgl.util.glu.Cylinder; //导入方法依赖的package包/类
public void drawCylinder(ResourceLocation texture) {
	Cylinder cylinder = new Cylinder();
	cylinder.setDrawStyle(GLU.GLU_FILL);
	cylinder.setNormals(GLU.GLU_SMOOTH);
	cylinder.setOrientation(GLU.GLU_OUTSIDE);
	cylinderId = GL11.glGenLists(1);
	GL11.glNewList(cylinderId, GL11.GL_COMPILE);
	Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
	cylinder.draw(0.5F, 0.5F, 10, 10, 2);
	GL11.glEndList();
	cylinder.setDrawStyle(GLU.GLU_FILL);		
	cylinder.setNormals(GLU.GLU_SMOOTH);
	cylinder.setOrientation(GLU.GLU_INSIDE);
	secondcylinderId = GL11.glGenLists(2);
	GL11.glNewList(secondcylinderId, GL11.GL_COMPILE);
	Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
	cylinder.draw(0.49F, 0.49F, 10, 10, 2);
	GL11.glEndList();	
}
 
开发者ID:Alex-the-666,项目名称:It-s-About-Time-Minecraft-Mod,代码行数:20,代码来源:ProxyClient.java

示例2: renderPoint

import org.lwjgl.util.glu.Cylinder; //导入方法依赖的package包/类
private void renderPoint() {
	GL11.glPushMatrix();
	RenderUtils.setup3DLightlessModel();
	GL11.glBegin(1);
	GL11.glVertex3d(-0.5D, 0.0D, 0.0D);
	GL11.glVertex3d(0.0D, 0.0D, 0.0D);
	GL11.glVertex3d(0.0D, 0.0D, -0.5D);
	GL11.glVertex3d(0.0D, 0.0D, 0.0D);

	GL11.glVertex3d(0.5D, 0.0D, 0.0D);
	GL11.glVertex3d(0.0D, 0.0D, 0.0D);
	GL11.glVertex3d(0.0D, 0.0D, 0.5D);
	GL11.glVertex3d(0.0D, 0.0D, 0.0D);
	GL11.glEnd();
	
	Cylinder c = new Cylinder();
	GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
	GL11.glLineWidth(0.5F);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	c.setDrawStyle(GLU.GLU_SILHOUETTE);
	c.setNormals(GLU.GLU_SMOOTH);
	c.draw(0.5F, 0.5F, 0.1F, 400, 1);
	
	Cylinder c2 = new Cylinder();
	GL11.glLineWidth(0.5F);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	c2.setDrawStyle(GLU.GLU_SILHOUETTE);
	c2.setNormals(GLU.GLU_SMOOTH);
	c2.draw(0.3F, 0.3F, 0.1F, 200, 1);
	
	Cylinder c3 = new Cylinder();
	GL11.glLineWidth(0.5F);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	c3.setDrawStyle(GLU.GLU_SILHOUETTE);
	c3.setNormals(GLU.GLU_SMOOTH);
	c3.draw(0.1F, 0.1F, 0.1F, 100, 1);
	RenderUtils.shutdown3DLightlessModel();
	GL11.glPopMatrix();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:40,代码来源:ModuleTrajectories.java

示例3: renderBeam

import org.lwjgl.util.glu.Cylinder; //导入方法依赖的package包/类
public static void renderBeam(double x, double y, double z, double desierdx, double desierdy, double desierdz, double red, double green, double blue, double alpha, float radius){
	GL11.glPushMatrix();
	FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/weapons/textures/models/dynamiclyColor.png");
	double lenght = Math.sqrt(Math.pow(x - desierdx, 2) + Math.pow(y - desierdy, 2) + Math.pow(z - desierdz, 2));
	double a = x - desierdx;
	double b = z - desierdz;
	double c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
	double secondb = y - desierdy;
	double secondc = Math.sqrt(Math.pow(c, 2) + Math.pow(secondb, 2));
	double yaw = Math.asin(b/c);
	double pitch = Math.asin(secondb/secondc);
	RenderUtils.color(red, green, blue, alpha);
	GL11.glTranslated(x, y, z);
	if((x - desierdx) > 0 && (z - desierdz) > 0){
		GL11.glRotatef(-180, 0, 1, 0);
		GL11.glRotatef((float)Math.toDegrees(yaw), 0, 1, 0);
	}
	else if((x - desierdx) < 0 && (z - desierdz) > 0){
		GL11.glRotatef((float)Math.toDegrees(yaw) + 90, 0, 1, 0);
	}
	else if((x - desierdx) > 0 && (z - desierdz) < 0){
		GL11.glRotatef(-(float)Math.toDegrees(yaw) - 90, 0, 1, 0);
	}
	else{
		GL11.glRotatef(-(float)Math.toDegrees(yaw), 0, 1, 0);
	}
	if((y - desierdy) > 0){
		GL11.glRotatef(-90, 1, 0, 0);
	}
	GL11.glRotatef((float)Math.toDegrees(pitch), 1, 0, 0);
	Cylinder cyl = new Cylinder();
	cyl.draw(radius, radius, (float)lenght, 16, 1);
	GL11.glPopMatrix();
}
 
开发者ID:Pumuckl007,项目名称:WeaponsMod,代码行数:35,代码来源:RenderUtils.java

示例4: drawCylinder

import org.lwjgl.util.glu.Cylinder; //导入方法依赖的package包/类
static public void drawCylinder(float baseRadius, float topRadius, float height, int slices, int stacks, Cylinder data) {

		//Cylinder c = new Cylinder();
	
		data.draw(baseRadius, topRadius, height, slices, stacks);
		
		//System.out.println(baseRadius + " " + topRadius + " " + height + " " + slices + " " + stacks);

	}
 
开发者ID:kephale,项目名称:brevis,代码行数:10,代码来源:Basic3D.java

示例5: drawCylinder

import org.lwjgl.util.glu.Cylinder; //导入方法依赖的package包/类
static public void drawCylinder(float baseRadius, float topRadius, float height, int slices, int stacks) {

		Cylinder c = new Cylinder();
	
		c.draw(baseRadius, topRadius, height, slices, stacks);
		
		//System.out.println(baseRadius + " " + topRadius + " " + height + " " + slices + " " + stacks);

	}
 
开发者ID:kephale,项目名称:brevis,代码行数:10,代码来源:BrShape.java


注:本文中的org.lwjgl.util.glu.Cylinder.draw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。