From 0ea1d388651217697d49029820b02b4f002f1ac0 Mon Sep 17 00:00:00 2001 From: neoraider Date: Fri, 15 Feb 2008 19:10:04 +0000 Subject: zoomedit: Made rotation tool much nicer ;-) --- Renderer.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Renderer.cpp') diff --git a/Renderer.cpp b/Renderer.cpp index 0a4f403..c95779a 100644 --- a/Renderer.cpp +++ b/Renderer.cpp @@ -69,6 +69,20 @@ void Renderer::drawCircle(const Vertex &m, float r, int n) { glEnd(); } +void Renderer::drawCircleDotted(const Vertex &m, float r, int n, int d, float rot) { + glBegin(GL_LINES); + + for(int i = 0; i < n; i++) { + if(2*d*(i%(n/d)) >= n) + continue; + + glVertex2f(m.getX()+r*cosf(rot+2*M_PI*i/n), m.getY()+r*sinf(rot+2*M_PI*i/n)); + glVertex2f(m.getX()+r*cosf(rot+2*M_PI*(i+1)/n), m.getY()+r*sinf(rot+2*M_PI*(i+1)/n)); + } + + glEnd(); +} + void Renderer::fillCircle(const Vertex &m, float r, int n) { glBegin(GL_POLYGON); -- cgit v1.2.3