# How to draw a clean and nice beizer curve

Good morning (for me it’s tomorrow, for others maybe in the evening) to you all, I just woke up at 4am and in the meantime I just got a question:

How do all these VectorArt programs make your pictures not contain any pixel? I’ve been looking for the answer for months: They use math (I know that some people feel bad just because of this word). But there is something I could never really answer: How can I use it in Studio?

Let’s get to the point: I want to create a cubic bezier curve, I know the mathematics but my main fear is that it’s raster type (for those who don’t know, raster type is like pixel type, just that you use a lot of pixels). For those who do not understand me: I watched this video on YouTube:

And when I remembered this Roblox tutorial:

I saw clearly that it’s really pixelated. And I don’t want that, I want it to be like the video. One possibility would be to use many, smaller frames, but if you have more frames, you use more memory and that could be a problem if you have more than 1000 frames. The second possibility would be something similar to the video, some method/function that fulfills this wish, but unfortunately Roblox does not have that. Maybe I missed something or did not read something? Is it even possible to imitate it in Roblox (I know it is possible with beams, but is it possible without beams)?

1 Like

Unity lets you write actual pixel data to images, which is probably how it’s done in that video. Just uses enough pixels to make it look smooth. And you’re wright, we can’t do that in Roblox because we can’t write pixel (or mesh) data, and we can’t use enough Frame objects to fake it, because that’d be way too inefficient (probably, haven’t tested).

Instead of using square 1x1 Frames as pixels, you could instead use e.g. 10x1 frames to make small line segments, and just connect dots along the curve. You’ll get a fairly “jagged” curve, but at least it won’t be pixelated. The wiki page you linked even covers arc-length parameterization, which should contain enough info to have more tightly spaced segments where there’s greater curvature and a jagged curve looks worse than a straight curve.

What exactly is your use case? Using Beams might really be the best option.

1 Like

I really asked out of curiosity, this question has been on my mind for months and I wanted to get rid of it. Thanks for the answer, there is only one thing left to do:
Beams are more 3D objects than 2D objects, right? Then you can’t save beams in the StarterGui, or am I just wrong (saving is possible, I was thinking more about rendering, so if it would be visible?)

1 Like

Beams have a property that make them always face the camera, so you can just make it look 2D.

Also, no, I don’t believe you can save them to the starter gui, but you might be able to do something via WorldToScreenPoint or one of the similar functions. I haven’t done this before, so it’ll require experimentation, but it’s probably your best bet for the level of quality you want.

2 Likes

If you attached the beams to the camera in the same way as first-person viewmodels are usually done, you could get a 2d-ish effect.

1 Like