StatRings - Anchor configuration preview
View Single Post
08-01-12, 08:19 AM
A Pyroguard Emberseer
Join Date: Jul 2008
Actually I came back the the rings lately and wrote myself a small script to test some stuff with processing.js.
Doing pie-charts can be done with a nearly similar approach.
Rings have a problem when only one ring segment is looked at. If the ring extends to more than one segment or only one segment is used and either SA (start alpha) starts at 0 or EA (end alpha) at 90 then there is no problem.
Example...if we want our ring to start at 10 degree and it should be our healthbar. There is no problem as long as the health values is high enough to take place in more that just one segment. Assuming health is taking up 4 ring segments the health has to drop below 25% that only one ring segment is affected.
Now the problem comes with the ring size. The thiner the ring the later the problem will appear.
The problem occurs if this condition is true
(Oy2 < Iy1) && (Ox1 > Ix2)
The triangles can still be calculates but they will be huge and the size will not fit. Not sure if there is actually a formula that can describe the white space between the two squares and if there is any textures function that allows as to squish a texture in that spot.
Same example with a thicker ring:
Normally we would fit a slice texture in the remaining triangle spots but that is impossible on certain scenarios especially if the ring starts at an degree that is not 0 or 90.
Actually I foud a way to describe the white space:
Now I have to ask myself if I can stretch a slice texture into those 4 triangles...hmmm
Well if we could use a square texture instead of a slice that works two...but we would need to squeeze two square textures like this:
No clue if that is possible with SetTexCoord.
| Simple is beautiful.
Roth UI FAQ
"I wonder what the non-pathetic people are doing tonight?"
- Rajesh Koothrappali (The Big Bang Theory)
Last edited by zork : 08-01-12 at
View Public Profile
Send a private message to zork
Visit zork's homepage!
Find More Posts by zork