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


Java Sphere.draw方法代码示例

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


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

示例1: init

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
@Override
public void init(FMLInitializationEvent e) {
	super.init(e);
	{
		Sphere sphere = new Sphere();
		sphere.setDrawStyle(GLU.GLU_FILL);
		sphere.setNormals(GLU.GLU_SMOOTH);
		sphere.setOrientation(GLU.GLU_OUTSIDE);

		defierSphereIdOutside = GL11.glGenLists(1);
		GL11.glNewList(defierSphereIdOutside, GL11.GL_COMPILE);
		sphere.draw(0.5F, 30, 30);
		GL11.glEndList();

		sphere.setOrientation(GLU.GLU_INSIDE);
		defierSphereIdInside = GL11.glGenLists(1);
		GL11.glNewList(defierSphereIdInside, GL11.GL_COMPILE);
		sphere.draw(0.5F, 30, 30);
		GL11.glEndList();
	}
	ClientRegistry.bindTileEntitySpecialRenderer(DefierTileEntity.class, new DefierTESR());
	ClientRegistry.bindTileEntitySpecialRenderer(EnergyProviderTileEntity.class, new EnergyProviderTESR());
}
 
开发者ID:tiffit,项目名称:Defier,代码行数:24,代码来源:ClientProxy.java

示例2: drawSphere

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
public static void drawSphere(double x, double y, double z, float size, int slices, int stacks) {
	final Sphere s = new Sphere();
	GL11.glPushMatrix();
	GL11.glBlendFunc(770, 771);
	GL11.glEnable(GL_BLEND);
	GL11.glLineWidth(1.2F);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL_DEPTH_TEST);
	GL11.glDepthMask(false);
	s.setDrawStyle(GLU.GLU_SILHOUETTE);
	GL11.glTranslated(x - RenderManager.renderPosX, y - RenderManager.renderPosY, z - RenderManager.renderPosZ);
	s.draw(size, slices, stacks);
	GL11.glLineWidth(2.0F);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL_DEPTH_TEST);
	GL11.glDepthMask(true);
	GL11.glDisable(GL_BLEND);
	GL11.glPopMatrix();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:RenderUtils.java

示例3: drawCircle

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

示例4: paintPointCloud

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
private void paintPointCloud(PointCloud pointCloud) {
    Sphere s = new Sphere();
    //Use the color
    GL11.glColor4d(pointCloud.color.getRed()/255.0d, pointCloud.color.getGreen()/255.0d, pointCloud.color.getBlue()/255.0d, pointCloud.color.getAlpha()/255.0d);

    for (Point3d p: pointCloud.points) {
        GL11.glPushMatrix();
        GL11.glTranslated(p.x,p.y,p.z);
        s.draw(0.04f, 3, 3);
        GL11.glPopMatrix();
    }
}
 
开发者ID:CallForSanity,项目名称:Gaalop,代码行数:13,代码来源:SimpleLwJglRenderingEngine.java

示例5: renderStatic

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
/**
 * Renders the planet by itself without calculating orbits or anything.
 * Used for rendering planets on gui buttons.
 */
public void renderStatic(Minecraft mc) {
	ResourceLocation img = new ResourceLocation("futurecraft", surfacePath);
	mc.getTextureManager().bindTexture(img);
	
	glColor3f(1, 1, 1);
       Sphere sphere = new Sphere();
       sphere.setTextureFlag(true);
       sphere.draw(10, 25, 25);
}
 
开发者ID:TEAMModding,项目名称:FutureCraft,代码行数:14,代码来源:Planet.java

示例6: render

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
public void render(float x, float y, float z) {
	glPushMatrix();
	glTranslatef(x, y, z);
	Sphere s = new Sphere();
	s.draw(radius, 16, 16);
	glPopMatrix();
}
 
开发者ID:Melanistic,项目名称:CubeShaft,代码行数:8,代码来源:Sun.java

示例7: drawSphere

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
public static void drawSphere(int facets)
    {
        Sphere s = new Sphere();            // an LWJGL class
        s.setOrientation(GLU.GLU_OUTSIDE);  // normals point outwards
        s.setTextureFlag(true);             // generate texture coords
//        GL11.glPushMatrix();
//        {
//	        GL11.glRotatef(-90f, 1,0,0);    // rotate the sphere to align the axis vertically
	        s.draw(1, facets, facets);              // run GL commands to draw sphere
//        }
//        GL11.glPopMatrix();
    }
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:13,代码来源:GraphicUtil.java

示例8: renderSphere

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
public static void renderSphere(double x, double y, double z, double r, double g, double b, double alpha, float radius) {
	GL11.glPushMatrix();
	FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/weapons/textures/models/dynamiclyColor.png");
	RenderUtils.color(r, g, b, alpha);
	GL11.glTranslated(x, y, z);
	Sphere s = new Sphere();
	s.draw(radius, 32, 16);
	GL11.glPopMatrix();
}
 
开发者ID:Pumuckl007,项目名称:WeaponsMod,代码行数:10,代码来源:RenderUtils.java

示例9: render

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
/**
 * Render's an awesome star.
 */
public void render(Camera cam, float time) {
	Tessellator tessellator = Tessellator.getInstance();
       WorldRenderer renderer = tessellator.getWorldRenderer();
       
       //draw the star itself
	glPushMatrix();
	GlStateManager.disableLighting();
	GlStateManager.disableTexture2D();
	glTranslatef(0, 0, 0);
	glColor3f(2.0f, 2.0f, 2.0f);
       Sphere sphere = new Sphere();
       sphere.setTextureFlag(false);
       sphere.setNormals(GLU.GLU_SMOOTH);
       sphere.draw((this.physical.diameter / 1000000) * 2, 100, 100);
       glPopMatrix();
       
       //draw the star glow
       glPushMatrix();
       GlStateManager.enableTexture2D();
       glBlendFunc(GL_ONE, GL_ONE);
       Textures.loadTexture("textures/environment/star_glow.png");
       glRotatef((float)-cam.rot.x, 0, 1, 0);
       glRotatef((float)-cam.rot.y, 1, 0, 0);
       float glowSize = ((this.physical.diameter / 1000000) * 2) * 20;
       
       renderer.startDrawingQuads();
       renderer.setColorRGBA(255, 255, 255, 255);
       renderer.addVertexWithUV(-glowSize, -glowSize, 0, 0, 1);
       renderer.addVertexWithUV(glowSize, -glowSize, 0, 1, 1);
       renderer.addVertexWithUV(glowSize, glowSize, 0, 1, 0);
       renderer.addVertexWithUV(-glowSize, glowSize, 0, 0, 0);
       tessellator.draw();
       
       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
       glPopMatrix();
       
       GlStateManager.enableLighting();
       GlStateManager.enableTexture2D();
       this.renderChildren(cam, time);
}
 
开发者ID:TEAMModding,项目名称:FutureCraft,代码行数:44,代码来源:Star.java

示例10: registerRenderInformation

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
@Override
public void registerRenderInformation() {

	Sphere sphere = new Sphere();
	// GLU_POINT will render it as dots.
	// GLU_LINE will render as wireframe
	// GLU_SILHOUETTE will render as ?shadowed? wireframe
	// GLU_FILL as a solid.
	sphere.setDrawStyle(GLU.GLU_FILL);
	// GLU_SMOOTH will try to smoothly apply lighting
	// GLU_FLAT will have a solid brightness per face, and will not shade.
	// GLU_NONE will be completely solid, and probably will have no depth to
	// it's appearance.
	sphere.setNormals(GLU.GLU_SMOOTH);
	// GLU_INSIDE will render as if you are inside the sphere, making it
	// appear inside out.(Similar to how ender portals are rendered)
	sphere.setOrientation(GLU.GLU_OUTSIDE);

	sphere.setTextureFlag(true);
	// Simple 1x1 red texture to serve as the spheres skin, the only pixel
	// in this image is red.
	// sphereID is returned from our sphereID() method
	sphereID = GL11.glGenLists(1);
	// Create a new list to hold our sphere data.
	GL11.glNewList(sphereID, GL11.GL_COMPILE);
	// Offset the sphere by it's radius so it will be centered
	GL11.glTranslatef(0.50F, 0.50F, 0.50F);

	sphere.draw(0.5F, 12, 24);
	// Drawing done, unbind our texture
	// Tell LWJGL that we are done creating our list.
	GL11.glEndList();
	
	
	
	Sphere sphereInside = new Sphere();
	sphereInside.setDrawStyle(GLU.GLU_FILL);
	sphereInside.setNormals(GLU.GLU_NONE);
	sphereInside.setOrientation(GLU.GLU_INSIDE);

	sphereInside.setTextureFlag(true);
	sphereID2 = GL11.glGenLists(1);
	GL11.glNewList(sphereID2, GL11.GL_COMPILE);
	GL11.glTranslatef(0.50F, 0.50F, 0.50F);

	sphereInside.draw(0.5F, 12, 24);
	GL11.glEndList();

}
 
开发者ID:ArtixAllMighty,项目名称:rpginventory,代码行数:50,代码来源:ClientProxy.java

示例11: initialize

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
@Override
public void initialize() {
    ambient = allocFloats(colorDefaultDiffuse);
    diffuse = allocFloats(colorDefaultDiffuse);
    specular = allocFloats(colorDefaultSpecular);
    shininess = allocFloats(new float[]{32.0f, 0.0f, 0.0f, 0.0f});

    light = allocFloats(colorDefaultLight);
    lightPos0 = allocFloats(lightDefaultPos0);
    lightPos1 = allocFloats(lightDefaultPos1);

    display_list = GL11.glGenLists(1);

    GL11.glNewList(display_list, GL11.GL_COMPILE);

    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_LIGHT0);
    GL11.glEnable(GL11.GL_LIGHT1);
    GL11.glShadeModel(GL11.GL_SMOOTH);

    GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT, ambient);
    GL11.glMaterial(GL11.GL_FRONT, GL11.GL_DIFFUSE, diffuse);
    GL11.glMaterial(GL11.GL_FRONT, GL11.GL_SPECULAR, specular);
    GL11.glMaterial(GL11.GL_FRONT, GL11.GL_SHININESS, shininess);

    GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, light);
    GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, light);
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, light);

    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, lightPos0);
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, lightPos1);

    GL11.glColor3f(1.0f, 0.0f, 0.0f);

    Sphere s = new Sphere();
    s.setDrawStyle(GLU.GLU_FILL);
    s.setNormals(GLU.GLU_SMOOTH);
    s.draw(3.8f, 100, 100);

    GL11.glDisable(GL11.GL_LIGHT1);
    GL11.glDisable(GL11.GL_LIGHT0);
    GL11.glDisable(GL11.GL_LIGHTING);

    GL11.glEndList();

}
 
开发者ID:rvt,项目名称:cnctools,代码行数:47,代码来源:BeadActor.java

示例12: drawSphere

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
private void drawSphere() {
    if (displayListSphere == -1) {
        displayListSphere = glGenLists(1);

        Sphere sphere = new Sphere();
        sphere.setTextureFlag(true);

        glNewList(displayListSphere, GL11.GL_COMPILE);

        sphere.draw(16, 16, 128);

        glEndList();
    }

    glCallList(displayListSphere);
}
 
开发者ID:zoneXcoding,项目名称:Mineworld,代码行数:17,代码来源:Skysphere.java

示例13: main

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
public static void main(String[] args) {
        G3D.init(800, 600);
        
        Texture.enable();
        
//        Texture tex = Texture.fromFile("res/16079.jpg", false);
        Texture tex = Texture.fromFile("res/earthmap1k.jpg", false);
        
        Sphere sphere = new Sphere();
        sphere.setDrawStyle(GLU.GLU_FILL);
        sphere.setTextureFlag(true);
        sphere.setNormals(GLU.GLU_SMOOTH);
        
        int sphereId = glGenLists(1);
        
        glNewList(sphereId, GL_COMPILE);
        tex.use();
        sphere.draw(2.3f, 50, 50);
        tex.stop();
        glEndList();

        glClearColor(0.5f, 0.5f, 0.5f, 0.5f);
        G3D.loop(30, () -> {
            glTranslatef(0, 0, z);
            glRotatef(angle++, 0, 1, 0);
            
            glCallList(sphereId);
            
            if (dir) {
                z--;
                if (z < -80) {
                    dir = false;
                }
            } else {
                z++;
                if (z > -10) {
                    dir = true;
                }
            }
        });
    }
 
开发者ID:akarnokd,项目名称:akarnokd-opengl-experiment,代码行数:42,代码来源:SimpleSphere.java

示例14: drawSphere

import org.lwjgl.util.glu.Sphere; //导入方法依赖的package包/类
static public void drawSphere(float r, int stack, int string) {

		Sphere s = new Sphere();
	
		s.draw(r, stack, string);
		

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


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