Coder Social home page Coder Social logo

dmitriysalnikov / godot_debug_draw_3d Goto Github PK

View Code? Open in Web Editor NEW
368.0 9.0 17.0 385.73 MB

Draw 3D debug graphics and 2D overlays with this add-on.

Home Page: https://dd3d.dmitriysalnikov.ru/

License: Other

Python 4.20% GDScript 8.38% C++ 78.09% Batchfile 0.34% C# 7.96% C 1.03%
csharp gdnative gdscript godot godot-engine gdextension godot4

godot_debug_draw_3d's Introduction

icon

Debug drawing utility for Godot

This is an add-on for debug drawing in 3D and for some 2D overlays, which is written in C++ and can be used with GDScript or C#.

Based on my previous addon, which was developed only for C#, and which was inspired by Zylann's GDScript addon

Support me

Your support adds motivation to develop my public projects.

Boosty

USDT-TRC20

USDT-TRC20 TEw934PrsffHsAn5M63SoHYRuZo984EF6v

Features

3D:

  • Arrow
  • Billboard opaque square
  • Box
  • Camera Frustum
  • Cylinder
  • Gizmo
  • Grid
  • Line
  • Line Path
  • Line with Arrow
  • Plane
  • Points
  • Position 3D (3 crossing axes)
  • Sphere

2D:

  • [Work in progress]

Overlay:

  • Text (with grouping and coloring)
  • FPS Graph
  • Custom Graphs

Precompiled for:

  • Windows
  • Linux (built on Ubuntu 20.04)
  • macOS (10.14+)
  • Android (5.0+)
  • iOS
  • Web (Firefox not supported)

This addon supports working with several World3D and different Viewports. There is also a no depth test mode and other settings that can be changed for each instance.

screenshot_web

Warning

  • Firefox most likely can't run this demo

Download

To download, use the Godot Asset Library or download the archive by clicking the button at the top of the main repository page: Code -> Download ZIP, then unzip it to your project folder. Or use one of the stable versions from the GitHub Releases page (just download one of the Source Codes in assets).

Installation

  • Close editor
  • Copy addons/debug_draw_3d to your addons folder, create it if the folder doesn't exist
  • Launch editor

Examples

More examples can be found in the examples_dd3d/ folder.

Simple test:

func _process(delta: float) -> void:
    var _time = Time.get_ticks_msec() / 1000.0
    var box_pos = Vector3(0, sin(_time * 4), 0)
    var line_begin = Vector3(-1, sin(_time * 4), 0)
    var line_end = Vector3(1, cos(_time * 4), 0)

    DebugDraw3D.draw_box(box_pos, Vector3(1, 2, 1), Color(0, 1, 0))
    DebugDraw3D.draw_line(line_begin, line_end, Color(1, 1, 0))
    DebugDraw2D.set_text("Time", _time)
    DebugDraw2D.set_text("Frames drawn", Engine.get_frames_drawn())
    DebugDraw2D.set_text("FPS", Engine.get_frames_per_second())
    DebugDraw2D.set_text("delta", delta)

screenshot_1

API

This project has a separate documentation page.

Also, a list of all functions is available in the documentation inside the editor (see DebugDraw3D and DebugDraw2D).

screenshot_4

Known issues and limitations

The text in the keys and values of a text group cannot contain multi-line strings.

The entire text overlay can only be placed in one corner, unlike DataGraphs.

Frustum of Camera3D does not take into account the window size from ProjectSettings.

More screenshots

DebugDrawDemoScene.tscn in editor screenshot_2

DebugDrawDemoScene.tscn in play mode screenshot_3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.