Skip to content

Conversation

@kfc35
Copy link
Contributor

@kfc35 kfc35 commented Dec 30, 2025

Objective

Solution

Testing

  • Ran cargo run --example 3d_gizmos --features=free_camera and saw that the green 3d square gizmo now closes
Screenshot 2025-12-30 at 4 06 41 PM
Modified Demo for Triangle 3d
use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, setup)
        .add_systems(Update, draw_shapes)
        .run();
}

fn setup(
    mut config_store: ResMut<GizmoConfigStore>,
    mut commands: Commands
)
{
    let (config, _) = config_store.config_mut::<DefaultGizmoConfigGroup>();
    config.line.width = 10.0;
    config.line.joints = GizmoLineJoint::Miter;

    commands.spawn((Camera3d::default(), 
        Transform::from_xyz(0.0, 0.0, -5.0).looking_at(Vec3::ZERO, Vec3::Z)));
}

fn draw_shapes(mut gizmos: Gizmos) {
    gizmos.primitive_3d(
        &Triangle3d { vertices: [Vec3::ZERO, Vec3::new(1.0, 0., 0.), Vec3::new(0.0, 1.0, 0.) ] },
        Vec3::new(0.0, 0.0, 0.),
        Color::srgb_u8(0xFF, 0, 0)
    );
}

Before (notice notch in bottom left hand corner):
Screenshot 2025-12-30 at 2 46 36 PM

After (notch in bottom left hand corner is gone):
Screenshot 2025-12-30 at 2 47 28 PM

@kfc35 kfc35 marked this pull request as draft December 30, 2025 20:09
@kfc35 kfc35 force-pushed the 22204_3d_gizmos_closed_shapes branch from 24e9b0a to 892caff Compare December 30, 2025 20:10
@kfc35 kfc35 marked this pull request as ready for review December 30, 2025 20:19
@JMS55 JMS55 requested a review from atlv24 December 31, 2025 03:18
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it A-Gizmos Visual editor and debug gizmos labels Dec 31, 2025
@alice-i-cecile alice-i-cecile added the C-Code-Quality A section of code that is hard to understand or change label Dec 31, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 31, 2025
@alice-i-cecile alice-i-cecile added this to the 0.18 milestone Dec 31, 2025
Merged via the queue into bevyengine:main with commit 1537f8c Dec 31, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Gizmos Visual editor and debug gizmos C-Bug An unexpected or incorrect behavior C-Code-Quality A section of code that is hard to understand or change S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bevy 3d_gizmos doesn't have closed shapes

3 participants