-
Notifications
You must be signed in to change notification settings - Fork 60
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
Node to draw 3D lines and splines #26
Comments
Dropping this here for interest, alas I don't know how to make custom nodes themselves: https://github.com/Zireael07/FreeRoamRoguelikeRacerPrototype/blob/master/game/scripts/draw_line.gd |
All you do is add |
I'd like to work on this since I'd like to easily have debugging visualization for stuff in 3D. I'll likely make a Singleton that can be called to spawn 3D objects, and then a script for each object such as LineGeometry3D, SphereGeometry3D, CurveGeometry3D, etc... But most importantly, what use cases are we aiming for here? In-editor tooling? Ingame debugging? Do they need to be persistent or clear afterwards, etc... I know my use case, which is visualization vectors to make physics debugging easier, but I'd like to know what it is we actually we want to support for this class. |
Personally, I use the little script I linked for both in-editor tooling and in-game debugging. |
I think the editor/game-time debugging use case is the main one here...but not sure if @aaronfranke has other use cases in mind. |
Yes, my use case is debugging, possibly both in-editor and in-game debugging. |
is this the same request as a basic LineRenderer like in Unity? Still i can't make any sort of laser beam or bullet line, this one drives me nuts |
@RichardEllicott: Yeah, pretty much Unity's LineRenderer. |
thankyou! this helped me out. How I got it to work: File Location: I drew lines from mountain peaks to their saddles |
thanks for this snippet... however i tested it and it's way short of Unity's LineRenderer this code's "line width" does not have any effect, also there is no way of applying a texture to the line |
So where can i request a "LineRenderer"? (like Unity) it takes a laser texure, like this one: and it sort of "always faces you" like how the billboard sprite does but when you have that special setting...... i have this feeling someone who programmed the billboard sprite, this almost could just be another setting ... like less code required than you think .... i don't personally care if it doesn't have multiple points, i can do that in code, it's the effect of it's look otherwise you have to crate a weird star shaped mesh to do laser lines, like this: i appreciate this is probably complicated for the devs under the hood but would be cool to get some sort of answer if it could be possible |
Yes, it's not equivalent to Unity's LineRenderer, but as I most often used Unity's for debugging, it's enough. As for texture, I believe it might be possible but you'd need to calculate all the UVs for all the vertices, etc. - IMHO a lot of pain for little gain. |
well i don't see how you can texture it as it doesn't have width, so pretty pointless unfortunately for my purposes i'm using little octagon cylinders atm.... for laser lines..... maybe the problem is more complicated than i give it credit, as the Unity LinerRenderer does render on top of everything (from my memory ~4 years back) |
I needed this for testing and it does the trick perfectly. This is great for simple things such as just redrawing the x-z-y axis lines that don't show up when you launch your scene. It also works great for drawing out a path that AStar path tracing has found. I also noticed the width didn't seem to be working but... didn't need it. |
I've been working on a DrawingUtils to draw lines and basic 2D shapes. I'll pull request once it's done. |
In Godot, I sometimes find that I would like the ability to draw lines in 3D. I think that such a thing might be a useful node to have in this node extensions repo.
Possible functionality:
Pass two points and have it draw a line between them
Pass an origin point and an offset, or a direction+magnitude
Pass an array of points and draw lines between all of them (index 0 to 1, then 1 to 2, etc)
Ability to set the thickness of the line
Ability to set color of the line, perhaps each end having a different color
The text was updated successfully, but these errors were encountered: