Posted May 23, 201510 yr 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! http://imagizer.imageshack.com/img661/3383/gPcPiH.gif[/img]
May 23, 201510 yr 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.
May 23, 201510 yr Author minecraft version should be provided for these kind of question, because rendering system changed a lot in 1.8 Apologies. Totally spaced it, but it's indeed 1.8. http://imagizer.imageshack.com/img661/3383/gPcPiH.gif[/img]
May 23, 201510 yr 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.
May 23, 201510 yr Author 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... http://imagizer.imageshack.com/img661/3383/gPcPiH.gif[/img]
May 23, 201510 yr 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.