Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: DrawCylinder radius results in cylinders that are 2x as wide as they should be. #40

Closed
JakeRabinowitz opened this issue Mar 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@JakeRabinowitz
Copy link

Godot version

v4.2.1.stable.mono.official [b09f793f5]

DebugDraw3D version

1.3.1

On which operating systems the error occurs

Windows

Using which renderers the error occurs

No response

Issue description

Hi again.

Looks like the radius field in DrawCylinderAb and DrawCylinder ends up drawing the cylinder 2x as wide as it should.

This CylinderMesh and the DrawCylinder both have a radius of 0.5, but the debug cylinder is twice as wide.
image

Also viewed from the top, you can see the debug cylinder has a diameter of 2 even though it's radius should be 0.5:
image

Steps to reproduce

  1. Create a Node3D.
  2. Add Attach a script to it and add the following code:
public override void _Process(double delta)
{
    float radius = 0.5f;
    float height = 2.0f;
    
    DebugDraw3D.DrawCylinderAb(
        Vector3.Up * height / 2,
        -(Vector3.Up * height / 2),
        radius,
        Colors.Green
    );
}

You'll see that the radius is 2x what it should be. You can compare to a CylinderMesh or CylinderShape3D.

Minimal reproduction project

N/A

@JakeRabinowitz JakeRabinowitz added the bug Something isn't working label Mar 6, 2024
@JakeRabinowitz JakeRabinowitz changed the title [Bug]: DrawCylinder radius is actually diameter [Bug]: DrawCylinder radius results in cylinders that are 2x as large as they should be. Mar 6, 2024
@JakeRabinowitz JakeRabinowitz changed the title [Bug]: DrawCylinder radius results in cylinders that are 2x as large as they should be. [Bug]: DrawCylinder radius results in cylinders that are 2x as wide as they should be. Mar 6, 2024
@DmitriySalnikov
Copy link
Owner

DmitriySalnikov commented Mar 6, 2024

Yes, there were questions about specifying the radius or diameter, and I changed it several times. But as far as I remember, the Transform3D version relies on Radius = 1.

image

But it looks like I outplayed myself when I was doing draw_cylinder_ab 😅
(And it seems to me that I didn't even check the size of the _ab version 🤔)

@DmitriySalnikov
Copy link
Owner

DmitriySalnikov commented Mar 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants