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.

Featured Replies

Posted

Hey Guys,

 

i'm trying to render my own projectile and get strange results.

Sometimes it works and sometimes the Projectile behave weird.

 

I recorded the my issue here: https://youtu.be/pZzjO-KiXuE

 

 

Here is my code for the renderer:

@Override
    public void doRender(EntityShockRifleProjectile entity, double x, double y, double z, float entityYaw, float partialTicks) {
        this.bindEntityTexture(entity);
        GlStateManager.pushMatrix();
        GlStateManager.disableLighting();
        GlStateManager.disableCull();
        GlStateManager.translate((float) x, (float) y, (float) z);
        GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) - 90.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch), 0.0F, 0.0F, 1.0F);
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuffer();
        GlStateManager.enableRescaleNormal();

        GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.scale(0.05625F * 3, 0.05625F * 3, 0.05625F * 3);
        GlStateManager.translate(-4.0F, 0.0F, 0.0F);

        final Color projectileColor = new Color(0, 139, 255, 255);

        GlStateManager.color(1F / 255F * projectileColor.getRed(),
                             1F / 255F * projectileColor.getGreen(),
                             1F / 255 * projectileColor.getBlue(),
                             1F / 255 * projectileColor.getAlpha());

        final double width = 8.0D;
        final double height = 0.5D;

        for (int j = 0; j < 4; ++j) {
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.glNormal3f(0.0F, 0.0F, 0.05625F);

            bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);

            bufferbuilder.pos(-width, -height, 0.0D).tex(0.0D, 0.0D).endVertex();
            bufferbuilder.pos(width, -height, 0.0D).tex(1, 0.0D).endVertex();
            bufferbuilder.pos(width, height, 0.0D).tex(1, 1).endVertex();
            bufferbuilder.pos(-width, height, 0.0D).tex(0.0D, 1).endVertex();

            tessellator.draw();
        }

        GlStateManager.disableRescaleNormal();
        GlStateManager.enableLighting();
        GlStateManager.enableCull();
        GlStateManager.popMatrix();
    }

 

I tried my best to figure out what is causing this behavior but i don't know that much about GL & Rendering. :S

I would be very happy about help ^^

 

:Edit

This issue just happens on the client who is shooting the projectile.

The other players see those 'buggy' projectiles without any problems.

Edited by Skyriis

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.