Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

2D Circle / Rounded Corner Rect Rendering

Featured Replies

Posted

I have been trying to render a 2D circle on a GUI. Here is what I ended up with after a lot of google searches:
 

public static void drawCirc(double p_73734_0_, double p_73734_1_, double p_73734_2_, int p_73734_4_) {
        float var10 = (float) (p_73734_4_ >> 24 & 255) / 255.0F;
        float var6 = (float) (p_73734_4_ >> 16 & 255) / 255.0F;
        float var7 = (float) (p_73734_4_ >> 8 & 255) / 255.0F;
        float var8 = (float) (p_73734_4_ & 255) / 255.0F;
        double increment = 2*Math.PI/50;
        double cx = p_73734_0_;
        double cy = p_73734_1_;
        double radius = p_73734_2_;

        GL11.glColor4f(var6, var7, var8, var10);

        for(double angle = 0; angle < 2*Math.PI; angle+=increment){
            GL11.glBegin(GL11.GL_POLYGON);
            GL11.glVertex2d(cx,cy);
            GL11.glVertex2d(cx + Math.cos(angle)* radius, cy +
                    Math.sin(angle)*radius);
            GL11.glVertex2d(cx + Math.cos(angle + increment)*radius, cy +
                    Math.sin(angle + increment)*radius);
            GL11.glEnd();
        }
    }

However, it is not rendering. Nothing is coming up. I have tried a variety of tweaks to this code, but nothing is working.

I am unsure if mc's default tesselator is overriding my vertex's and stopping it from rendering or if I am being stupid, but no matter what I try, it doesn't render a circle.

I am hoping after I figure out how to render a circle, I can try rendering a rounded rectangle, but so far, it does not look promising. I am hoping someone on here knows how to do this correctly.
 

 
 
0
 Advanced issues found
 
 
Spoiler

P.S. I am using MCP, but I am sure you guys are still able to help.

 

Edited by PlumpOrange

Just an orange that codes

  • Author
4 hours ago, diesieben07 said:

Jarmodding is not supported on this forum.

Both mods and clients use OpenGL, my question would still apply to either. I'm just trying to figure out why my circle isn't rendering. Also, I've made posts on here about mcp development in the past, and outside of this account, with no issue. I don't understand why you are so strict on what platform you modify on.

 

Just an orange that codes

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.