Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Drawing a hyperbola in SFML  (Read 1700 times)

0 Members and 1 Guest are viewing this topic.

pamelablue

  • Newbie
  • *
  • Posts: 3
    • View Profile
Drawing a hyperbola in SFML
« 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!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Drawing a hyperbola in SFML
« Reply #1 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.
Laurent Gomila - SFML developer

pamelablue

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Drawing a hyperbola in SFML
« Reply #2 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.


 

anything