Jump to content

[1.9] Rendering Quad in World in TESR


SantacreeperLP

Recommended Posts

Hey, How can I render a Quad in the world and apply an TextureAtlasSprite to it?

I tried:

GL11.glBegin(GL11.GL_QUADS);
GL11.glColor3f(1.0f, 1.0f, 1.0f);
        GL11.glVertex3d(x, y, z);
        GL11.glVertex3d(x + 1, y, z);
        GL11.glVertex3d(x + 1, y + 1, z);
        GL11.glVertex3d(x, y + 1, z);
        GL11.glEnd();

 

But it isnt working... Please help me :) I think i cant use the default openGL functions :D

Link to comment
Share on other sites

Tessellator tessellator = Tessellator.getInstance();

WorldRenderer renderer = Tessellator.getInstance().getWorldRenderer();

renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); // The default vertex format depends on your use case, experiment.

For every vertex:

 

worldrenderer.pos(x,y,z) // If you have u,v you have to add some additional stuff

 

tessellator.draw()

 

 

Link to comment
Share on other sites

As of 1.9 WorldRenderer is VertexBuffer.

Lookup Gui.class for use examples of vertex format.

 

render a Quad in the world

 

You know, just adding and drawing vertexes will place them "who knows where". What is your translation/scale context? What event or other rendering are you using?

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.