Jump to content

Recommended Posts

Posted

Hey everyone,

Lately I've been working with the Tessellator, and it's almost nice. It seems that most people who use it, use it for blocks or for GUIs, however I'm not using it for either.

Instead I'm trying to render a box above entity heads. So far this is going okay, except it obviously doesn't rotate because I haven't set the vertices to update with the client. The actual code for the vertices is just:

// tw is just a worldrenderer from a tessellator object.
tw.addVertex(0,2,0);
tw.addVertex(0,3,0);
tw.addVertex(1,3,0);
tw.addVertex(1,2,0);

 

Like I said this works fine, but I am lost as to how to get this to rotate with the client. So I did some searching in the vanilla code and it looks like they handle it slightly differently. Their code for rotation is:

 

GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);

 

Because I'm using Tessellator and not a GlStateManager, I'm not sure how to go about this.

 

Any help would be appreciated!

Posted

minecraft version should be provided for these kind of question,

because rendering system changed a lot in 1.8

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

Then just use GlStateManager to rotate it.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

Then just use GlStateManager to rotate it.

In my attempt to use the GlStateManager I gave the player a permanent superman-pose disability.

 

While I won't ask for a tutorial on using GlStateManager, how do you access the statemanager for a Tessellator and a WorldRenderer object? The vanilla code on this doesn't make much sense to me...

You don't have to, and should not access the WorldRenderer object..

 

You need to put this before rendering yours:

GlStateManager.pushMatrix();

 

and this after yours:

GlStateManager.popMatrix();

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

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.