SFML community forums

Help => Graphics => Topic started by: pamelablue on January 05, 2021, 05:45:24 pm

Title: Drawing a hyperbola in SFML
Post by: pamelablue on January 05, 2021, 05:45:24 pm
Hello guys and girls!

New to programming and new to SFML. I have watched couple of videos on Youtube and have gone through most of the tutorials on site.

Is there a way to draw a hyperbola shape in SFML? The only alternative I see at the moment is making something that just resembles hyperbola with convex shapes by plotting multiple points which would make out a "curve" out of straight lines.

Many thanks for any help!
Title: Re: Drawing a hyperbola in SFML
Post by: Laurent on January 05, 2021, 06:08:08 pm
At the end the graphics card only understands 3 types of primitives: points, lines and triangles. So no matter what you do, the solution will be an approximation using lines or triangles.

The only alternative is to directly draw your curve pixel by pixel on a texture, and show that texture with a sprite.
Title: Re: Drawing a hyperbola in SFML
Post by: pamelablue on January 08, 2021, 02:42:13 pm
Thanks for your time and for you help!

This brings a lot of clarity now.

Have a good one.