Circular Sector - Image Drawing
BlitzMax Forums/BlitzMax Beginners Area/Circular Sector - Image Drawing
| ||
Hello all, I've posted something similar to this before, but I couldn't, at the time, find a suitable example to explain exactly what I was trying to achieve. Thankfully, Wiki has provided me with an ideal example: http://en.wikipedia.org/wiki/Circular_sector I want to be able to draw a circular image (for this examples sake, a dartboard) fully and then, over time 'reduce'. So essentially in the example picture on the Wiki link, è=0 to start with, and then 60 seconds later è=360. I could get the mathematics to work OK, but how would I 'draw an image' in this format? Pondered a number of methods but nothing has produced the result as expected. Please let me know if explaining further would help. Kindest regards, Matt... |
| ||
The fastest way I can think of would be to draw textured polygons. There's code lying around somewhere to do that. |
| ||
Is it something to do with 'Triangle Fan' or some such thing? Should mention I'm making a fully 2D game. I sort of imagined that many people must've wanted to have done this before - plus I've seen it in many games I've played, used in things such as timers, etc. |
| ||
what about the drawpolygon command? http://blitzbasic.com/bmdocs/command.php?name=DrawPoly&ref=2d_a-z Last edited 2011 |
| ||
Requires my Odd2D module linked in my sig or you can get it from here. Oh, and replace "dartboard.jpeg" with your own image. Enjoy! Last edited 2011 |
| ||
I got a little bored so I added a few options to play around with. Last edited 2011 |
| ||
what about the drawpolygon command? Amazing, I never knew this command existed... |
| ||
Hiya, sorry - I should've replied sooner. The oddmodule is very useful and works perfectly! Eill also experiment with DrawPolygon - I didn't know of it's existence either... :) |