SFML community forums
Help => Graphics => Topic started by: dleanjeanz on May 11, 2014, 11:35:31 am
-
How do you draw an isosceles triangle with the vertex angle of some specific angle (like 85º, 80º or 70º)?
What is the highest anti-aliasing level?
New question:
How do you put sf::CircleShape into a sf::Sprite?
To put something into a sf::Sprite, I have to use a texture. And to put something in the texture, I have to load an image. I have no idea how to do this.
-
What SFML needs are the positions of the vertices, so you need to do some trigonometry to figure out where you want the vertices to be given those conditions. The exact code you want probably only requires a couple of sin()/cos() calls.
The maximum available anti-aliasing level is determined by the hardware. I believe typical values are 2, 4 and 6, but I don't know how high it goes these days.
Edit: After some quick googling I found mentions of 16 and 32, so I guess the maximum is pretty high. I doubt most games would benefit from 32xAA though.
-
Would you mind drawing an isosceles triangle with an initial vertex point? I don't know anything about the er... trigonometry. Thanks. :D
-
I think this covers all the trigonometry you'll need for dealing with simple triangles: http://www.dummies.com/how-to/content/trigonometry-for-dummies-cheat-sheet.html The Laws of Sines/Cosines are the most useful for this particular question.
And no, I'm not going to write the code for you. You have to learn how to figure these things out for yourself =)
-
Hey, is it possible to make a rectangle shaped texture/image become parallelogram shaped?
-
Sure. If you draw it with a sf::VertexArray rather than an sf::Sprite, you can use any vertices you like, which will allow you to "twist" the rectangular texture into a parallelogram or any other quadrilateral.
Make sure you read the tutorial on vertex arrays since they're a little bit more work than sprites.
-
OK. Thanks