Hi! I was wondering how circles, lines etc. are drawn in Love, but I can't find it in the source. Could someone who knows where to find it post a link, please? Also, if someone knows, I'd like to know what these algorithms are called.
Thanks a bunch!
How are circles drawn? (source link pls)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: How are circles drawn? (source link pls)
https://bitbucket.org/rude/love/src/10f ... s.cpp-1757
No idea how it does it internally though.
No idea how it does it internally though.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: How are circles drawn? (source link pls)
Maybe my question wasn't clear enough. I was wondering how it works under the hood.
Thank you for the link!zorg wrote: ↑Tue Jun 20, 2017 7:00 pm https://bitbucket.org/rude/love/src/10f ... s.cpp-1757
No idea how it does it internally though.
Well, I guess I still don't know how it works.
Re: How are circles drawn? (source link pls)
It constructs a list of vertices, then extrudes them sideways to make a polygon that's shaped like a polyline, and then renders it normally.
Re: How are circles drawn? (source link pls)
The actual code you want is at:
https://bitbucket.org/rude/love/src/10f ... s.cpp-1404
so raidho is right, it constructs a polygon, which then gets sent to the GPU as vertex data. The actual numbers just comes from the plain-jane cos/sin method: if you don't understand how this works, this wikipedia link might help:
https://en.wikibooks.org/wiki/Trigonome ... nit_Circle
https://bitbucket.org/rude/love/src/10f ... s.cpp-1404
so raidho is right, it constructs a polygon, which then gets sent to the GPU as vertex data. The actual numbers just comes from the plain-jane cos/sin method: if you don't understand how this works, this wikipedia link might help:
https://en.wikibooks.org/wiki/Trigonome ... nit_Circle
Re: How are circles drawn? (source link pls)
Thank you!
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests