Jump to content

[1.12.2] Where are addVertexWithUV function ?


zlappedx3

Recommended Posts

I can use addVertexData and addVertexWithUV from Tessellator but i understand that want call getWorldRenderer() on 1.8.9++ how to use addVertexWithUV from other version ?

In 1.7.10 i can rending it.

public void updateMirror(float partialTick) {
    	int w, h;
        float y, py, p, pp;
        boolean hide, pause;
        int view, limit;
        long endTime = 0;
        MovingObjectPosition mouseOver;
        w = mc.displayWidth;
        h = mc.displayHeight;
        y = mc.getRenderViewEntity().rotationYaw;
        py = mc.getRenderViewEntity().prevRotationYaw;
        p = mc.getRenderViewEntity().rotationPitch;
        pp = mc.getRenderViewEntity().prevRotationPitch;
        hide = mc.gameSettings.hideGUI;
        view = mc.gameSettings.thirdPersonView;
        limit = mc.gameSettings.limitFramerate;
        mouseOver = mc.objectMouseOver;
        
        switchToFB();
        
        mc.displayHeight = 180;
        mc.displayWidth = 320;
        mc.gameSettings.hideGUI = true;
        mc.getRenderViewEntity().rotationYaw += 180;
        mc.getRenderViewEntity().prevRotationYaw += 180;
        mc.getRenderViewEntity().rotationPitch = -p + 18;
        mc.getRenderViewEntity().prevRotationPitch = -pp + 18;
        
        GL11.glPushAttrib(GL11.GL_VIEWPORT_BIT | GL11.GL_ENABLE_BIT | GL11.GL_CURRENT_BIT | GL11.GL_POLYGON_BIT | GL11.GL_TEXTURE_BIT);
        
        mc.entityRenderer.updateCameraAndRender(partialTick, mc.getSystemTime());
        
        GL11.glPopAttrib();
        
        mc.objectMouseOver = mouseOver;
        mc.getRenderViewEntity().rotationYaw = y;
        mc.getRenderViewEntity().prevRotationYaw = py;
        mc.getRenderViewEntity().rotationPitch = p;
        mc.getRenderViewEntity().prevRotationPitch = pp;
        mc.gameSettings.limitFramerate = limit;
        mc.gameSettings.hideGUI = hide;
        mc.displayWidth = w;
        mc.displayHeight = h;
        mc.gameSettings.thirdPersonView = view;
        
        switchFromFB();
}
    
public void TickUpdate(float partialTick) {
		Tessellator tes = Tessellator.getInstance();
    	if (mc.theWorld == null || mc.currentScreen != null || mc.gameSettings.thirdPersonView != 0 || mc.thePlayer == null) return;
    	
        GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_CURRENT_BIT | GL11.GL_POLYGON_BIT | GL11.GL_TEXTURE_BIT);
        GL11.glMatrixMode(GL11.GL_PROJECTION);
        GL11.glLoadIdentity();
        GL11.glOrtho(0, mc.displayWidth, mc.displayHeight, 0, 1000, 3000);
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        GL11.glLoadIdentity();
        GL11.glTranslatef(0, 0, -2000);
        
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_LIGHTING);
        tes.getWorldRenderer().begin(GL11.GL_QUADS, tes.getWorldRenderer().getVertexFormat());
        GL11.glColor3ub((byte) 24, (byte) 24, (byte) 24);
        tes.getWorldRenderer().addVertexData(vertexData);
        tes.draw();
        
        GL11.glColor3ub((byte) 255, (byte) 255, (byte) 255);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, mirrorTex);
        tes.getWorldRenderer().begin(GL11.GL_QUADS, tes.getWorldRenderer().getVertexFormat());
        
        tes.draw();
        
        if (framecount++ % 2 == 0) {
        	updateMirror(partialTick);
        }
        
        GL11.glPopAttrib();
        mc.entityRenderer.setupOverlayRendering();
}


But other version how to use ?(sample from 1.8.9)
 

public void updateMirror(float partialTick) {
    	int w, h;
        float y, py, p, pp;
        boolean hide, pause;
        int view, limit;
        long endTime = 0;
        MovingObjectPosition mouseOver;
        w = mc.displayWidth;
        h = mc.displayHeight;
        y = mc.getRenderViewEntity().rotationYaw;
        py = mc.getRenderViewEntity().prevRotationYaw;
        p = mc.getRenderViewEntity().rotationPitch;
        pp = mc.getRenderViewEntity().prevRotationPitch;
        hide = mc.gameSettings.hideGUI;
        view = mc.gameSettings.thirdPersonView;
        limit = mc.gameSettings.limitFramerate;
        mouseOver = mc.objectMouseOver;
        
        switchToFB();
        
        mc.displayHeight = 180;
        mc.displayWidth = 320;
        mc.gameSettings.hideGUI = true;
        mc.getRenderViewEntity().rotationYaw += 180;
        mc.getRenderViewEntity().prevRotationYaw += 180;
        mc.getRenderViewEntity().rotationPitch = -p + 18;
        mc.getRenderViewEntity().prevRotationPitch = -pp + 18;
        
        GL11.glPushAttrib(GL11.GL_VIEWPORT_BIT | GL11.GL_ENABLE_BIT | GL11.GL_CURRENT_BIT | GL11.GL_POLYGON_BIT | GL11.GL_TEXTURE_BIT);
        
        mc.entityRenderer.updateCameraAndRender(partialTick, mc.getSystemTime());
        
        GL11.glPopAttrib();
        
        mc.objectMouseOver = mouseOver;
        mc.getRenderViewEntity().rotationYaw = y;
        mc.getRenderViewEntity().prevRotationYaw = py;
        mc.getRenderViewEntity().rotationPitch = p;
        mc.getRenderViewEntity().prevRotationPitch = pp;
        mc.gameSettings.limitFramerate = limit;
        mc.gameSettings.hideGUI = hide;
        mc.displayWidth = w;
        mc.displayHeight = h;
        mc.gameSettings.thirdPersonView = view;
        
        switchFromFB();
    }
    
public void TickUpdate(float partialTick) {
		Tessellator tes = Tessellator.getInstance();
    	if (mc.theWorld == null || mc.currentScreen != null || mc.gameSettings.thirdPersonView != 0 || mc.thePlayer == null) return;
    	
        GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_CURRENT_BIT | GL11.GL_POLYGON_BIT | GL11.GL_TEXTURE_BIT);
        GL11.glMatrixMode(GL11.GL_PROJECTION);
        GL11.glLoadIdentity();
        GL11.glOrtho(0, mc.displayWidth, mc.displayHeight, 0, 1000, 3000);
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        GL11.glLoadIdentity();
        GL11.glTranslatef(0, 0, -2000);
        
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_LIGHTING);
        tes.getWorldRenderer().begin(GL11.GL_QUADS, tes.getWorldRenderer().getVertexFormat());
        GL11.glColor3ub((byte) 24, (byte) 24, (byte) 24);
        tes.getWorldRenderer().addVertexData(vertexData);
        tes.draw();
        
        GL11.glColor3ub((byte) 255, (byte) 255, (byte) 255);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, mirrorTex);
        tes.getWorldRenderer().begin(GL11.GL_QUADS, tes.getWorldRenderer().getVertexFormat());
        
        tes.draw();
        
        if (framecount++ % 2 == 0) {
        	updateMirror(partialTick);
        }
        
        GL11.glPopAttrib();
        mc.entityRenderer.setupOverlayRendering();
}

 

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.



×
×
  • Create New...

Important Information

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