PDA

View Full Version : Please Help Me!



CrapAtCoding
02-22-2005, 03:32 PM
I am taking a scripting class and we are working on OpenGL right now and since I missed the first session due to being out of town on business...I'm kind of lost. I am trying to write a program where the user can click down in a window and drag the mouse in order to create a circle. When the user unclicks/lets go of their mouse, the circle is completed and then visible on the screen. When the user clicks in another location, a new circle is created while the first dissapears.

So far i have only been able to create shapes in a window using OpenGL. I have been given some code involving the trigonometry to help me but as my name suggests, I am crap at coding. can anyone help me out?

:confused:

MMMovania
02-22-2005, 08:31 PM
Hello there,
The task that you currently have is a simple one. Assuming that you are using glut, you have to set up a mouse function. In it you will store the click coordinates and on drag the radius for the circle. on mousup you set the circle to the radius just before the mouse button is released. I think this discusison would not make much sense to you . If you like i can help you out with the implementation. Thanx

CrapAtCoding
02-23-2005, 07:18 AM
Hi and thanks for your reply! I understand what you are talking about as that was what my teacher told me to do in order to complete the assignment. I have some code he gave me but I'm just not sure what to do with it...