View Full Version : no idea how to create round 2d objects using vertices

mindkiller

07-02-2012, 12:12 PM

Like the title is telling...

I have no idea how to create that, can someone please help me or send a link where I can find this informations please, thank´s :)

thokra

07-03-2012, 03:10 AM

Circles? Ellipses? You need two things, a mathematical description of your problem, i.e. how can a circle be defined mathematically, and some algorithm to generate vertices. For a filled circle, in contrast to a circle only rendered as a a number if line segments, you'll need a center vertex and some vertices at distance r (where r is the radius of the circle). Then you simply define a series of triangles which describe the form of the circle. The more triangles you generate, the better the approximation of the circle.

Check out http://en.wikipedia.org/wiki/Circle and there especially the parametric form of a circle. Since you're in 2D you'll have it especially easy.

Kopelrativ

07-03-2012, 08:06 AM

There may be an easy solution in 2d, which is using a quad where you use a texture that is a picture of a circle, and transparent elsewhere.

Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.