View Single Post
Unread 08-01-12, 07:19 AM   #12
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,343
Actually I came back the the rings lately and wrote myself a small script to test some stuff with processing.js.

http://dm.next-gen.org/files/ring/index.php

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
Code:
(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.

Example:
http://dm.next-gen.org/files/ring/in...=4&SA=10&EA=20

Same example with a thicker ring:
http://dm.next-gen.org/files/ring/in...10&SA=10&EA=20

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 | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 08-01-12 at 08:34 AM.
zork is offline   Reply With Quote