PDA

View Full Version : How draw Callipers in OpenGL



stuttt
04-29-2014, 09:10 AM
I was tasked by my teacher of cad computer graphic to do such thing. I do not know how begin. Is it beginner or advanced task? Maybe there are similar tasks. Should it be composite works with joining of primitives that were showed in printed manuals?

tonyo_au
04-29-2014, 06:54 PM
It depends on whether they are to be rendered in 3D or 2D and if you need to animate them or not. It makes a difference on how you approach the problem.

stuttt
05-19-2014, 05:46 AM
It should be drawn in 2d mode without animation. Would you refer for similar 2d object.
Except it I want to know where and how download library for OpenGL in Java and what is simplest way to draw objects and animation in Opengl--in c++, java or delphi-pascal (the last one is the least known by me).
For example--http://igeo.jp/tutorial/43.html--such samples ca be executed in standart java- compiler--J-grasp for example.

stuttt
05-20-2014, 12:20 PM
I really need this the solving of this task. Would be anybody show me algorithm of doing this. What functions i need to use how to join different figures. How make the scale with text?

stuttt
06-05-2014, 06:43 AM
In general I understand that I should use Line Loop connecting the vertices. But How to draw the arc of circles or even elipses as it needed there?
I there any method to do it simply without using trigonometry?
I aslo want to know if i draw one figure (f.e. polygon) and then other one can the last one be visible and first one not visible? As there is moving part of calliper that should hide the part of scale.

Osbios
06-05-2014, 03:00 PM
I think sfml (http://www.sfml-dev.org/) will do what you are looking for. Its a C++ library that manages a lot of basic stuff like window initiating/management, user input and also basic 2d drawing functions.

stuttt
06-06-2014, 12:16 PM
But it is probably wholly another technology. I would like to do it in opengl. Do glew and other subparts of opengl have better abilities to draw such calliper then in glut. Or maybe pascal graph is better to do it as it was first my alternative.

stuttt
06-08-2014, 05:03 AM
Here i need to draw the filled ring. So how to do it. I have such idea. I draw bigger circle with fill (how to add just there). then i draw the empty small circle inside the first one. Am i correct especially toward the using the trygonometry for circles draw.

stuttt
06-08-2014, 05:10 AM
Here i need to draw the filled ring. So how to do it. I have such idea. I draw bigger circle with fill (how to add just there). then i draw the empty small circle inside the first one. Am i correct especially toward the using the trygonometry for circles draw. So can the second empty fill to cover the first one

Aleksandar
06-08-2014, 05:21 AM
Just draw a triangle strip, alternatively defining vertices from the outer and inner ring. The nuber of steps depends on your choice and need to have fine tessellation.

stuttt
06-09-2014, 02:05 AM
So now I just I need how to get fill in the circle. When I used the glBegin (GL_Polygon) in place of GL_LINE_LOOP i got black fill. Why? How I can use any other fill. As there are two items. One circle ring: with the fill of inclined lines under the 45. The other one I need to fill the rectangle with more complex pattern with some ingraned pattern despite in 2d. Can i define some pattern in drawing editor and them use and upload for opengl fill? How to do it if possible, at least with predefined?