# Draw an ellipse

**URL:** <https://forums.unrealengine.com/t/draw-an-ellipse/1774701>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [March 27, 2024, 2:58pm UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701 "2024-03-27T14:58:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ViaCognita](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/viacognita/32/906601_2.png) [@ViaCognita](https://forums.unrealengine.com/u/ViaCognita)\
**Post date:** [March 27, 2024, 2:58pm UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/1 "2024-03-27T14:58:15Z")

</div>

Hi!

I’m using Unreal 5.3.2.

I need to draw some splines like these ones:

 ![3tg14](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/0/7c0048471d4c508a13e8df9328e260f0b5f69345.jpeg)

There lines represent the orbits of the planets around the Sun.

Someone has suggested me to use Debug lines, but is there another way to draw it? Maybe with Blueprint Splines.

Any suggestion?

Thanks.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 27, 2024, 3:08pm UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/2 "2024-03-27T15:08:40Z")

</div>

> [@ViaCognita](#):
>
> Maybe with Blueprint Splines

> [@Solar System Simulator/Generator](https://forums.unrealengine.com/t/solar-system-simulator-generator/62571/15):
>
> I lifted what was relevant from an old project (opening 4.17 → 4.27 is no fun at all! wink but still pretty stunned it actually opens & works almost out of the box!): Project link: Here’s what this actor can do: Some basic controls for this are exposed but it needs a ton of features to make it useable / more flexible. I’d start with adding controls for how many SMCs are needed for smaller / larger orbits - currently it’s a fixed number. May be fine depending on what this is going to be u…

You could also try Niagara ribbons.

> Debug lines

That’s PIE only unless you C++ it, Rama’s Victory plugin has it exposed afair.

---

<div class="post-metadata">

**Author:** ![ViaCognita](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/viacognita/32/906601_2.png) [@ViaCognita](https://forums.unrealengine.com/u/ViaCognita)\
**Post date:** [March 27, 2024, 4:49pm UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/3 "2024-03-27T16:49:44Z")

</div>

Thank you. You are great!

I need to draw an ellipse because planet orbits are ellipses. I think I could draw it with your Solar System Simulator/Generator, isn’t it?

Again, thank you.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 27, 2024, 4:51pm UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/4 "2024-03-27T16:51:55Z")

</div>

It does support it yes, as in the anim. Disclaimer: the script is 7-8 years old, there might be embarrassing elements there.

---

<div class="post-metadata">

**Author:** ![ViaCognita](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/viacognita/32/906601_2.png) [@ViaCognita](https://forums.unrealengine.com/u/ViaCognita)\
**Post date:** [March 27, 2024, 4:55pm UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/5 "2024-03-27T16:55:19Z")

</div>

Don’t worry. If you want I can show you my code, and that way we can be embarrassed together.

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [March 27, 2024, 8:37pm UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/6 "2024-03-27T20:37:30Z")

</div>

I had almost identical problem to tackle. Splines are really slow if you want to spawn them trough code. Niagara may work here.

However i made C++ code that calculates transforms on ellipse (no Kepler calculations, just ellipse with focal points). Transform is done so it always points (rotation) to next point on ellipse, and scale is scaling 1uu to distance between points.

However all that code is in C++ function library, i can provide copy of it, there are multiple functions all blueprintable.

Old screens:

 ![we_has_eliptical_orbits](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/f/dbfe1e44839d423f65517dfa7b5212e944336af4.jpeg)

 ![who_needs_Splines](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/5/6/e5693b179c64b840ea0c7525b9a24c6faa1e61b4.jpeg)

ps (just remembered):  
My function draws ellipses in 2d, then i have another function that recalculates array of those transforms into 3d space. I did not work on it for like 9 months (we dropped idea of drawing orbits).

---

<div class="post-metadata">

**Author:** ![Axyzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Axyzz](https://forums.unrealengine.com/u/Axyzz)\
**Post date:** [February 25, 2025, 12:07am UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/7 "2025-02-25T00:07:27Z")

</div>

Hello! Did you find a good way to do this?  
I tried using a spline with the solar system method that our friend shared, but I wanted the lines to not be affected by distance. For example, when we get closer to the spline, the lines created with the mesh become huge.  
I need the lines to maintain the same thickness regardless of distance, just like the debug lines of the spline.  
I’m not exactly sure what kind of lines these are, but I managed to get something similar using a wireframe material on the spline mesh. However, now I can’t control the thickness of the wireframe line, so I’m stuck again.

---

<div class="post-metadata">

**Author:** ![ViaCognita](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/viacognita/32/906601_2.png) [@ViaCognita](https://forums.unrealengine.com/u/ViaCognita)\
**Post date:** [February 25, 2025, 11:24am UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/8 "2025-02-25T11:24:45Z")

</div>

> [@Axyzz](#):
>
> Did you find a good way to do this?

No, sorry.

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [February 25, 2025, 5:44pm UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/9 "2025-02-25T17:44:32Z")

</div>

I know that there is a way to scale material to pixels in actual UMG widgets. Maybe there is way to scale it in 3d space. It should be some 3d vector math:

So stuff to consider:

- you can make material that uses world coordiantes, and it can draw lines/circles etc that are always 1 meter thick, however that will make those lines thinner further they are.
- you can get world position of pixel, and world position of camera
- all you need to do is calculate distance, then rescale that 1 meter thick line to something that is same size on screen

ps.  
I asked chatgpt for hlsl code:

```auto
float2 ScaledUV(float2 UV, float3 WorldPosition, float3 CameraPosition, float LineThickness)
{
    // Calculate view-space depth (distance from camera)
    float CameraDist = length(WorldPosition - CameraPosition);

    // Adjust UV scale based on distance
    float ScaleFactor = CameraDist * LineThickness;

    // Scale UVs
    return UV * ScaleFactor;
}

```

it is really simple, and i think this will work just fine. If i have time i may do it as material with nodes.

---

<div class="post-metadata">

**Author:** ![Axyzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Axyzz](https://forums.unrealengine.com/u/Axyzz)\
**Post date:** [February 25, 2025, 9:39pm UTC](https://forums.unrealengine.com/t/draw-an-ellipse/1774701/10 "2025-02-25T21:39:00Z")

</div>

Thanks a lot for your reply! I really liked your idea and will give it a try.
