PDA

View Full Version : Mouse troubles



Fyp2001
03-05-2001, 09:37 AM
How do you draw with mouse on 3d landscape???? I have created my 3d landscape and now i want the user to draw a closed area on the landscape that the user wants to place a feature eg tree on. I want the user to be able to draw only on the landscape and not on the screen above or below. I have no idea how to use mouse drawing in opengl and my attempts have resulted in the screen refreshing constantly and wiping out the mouse drawings. i am not using glut i am using nehe tutorials. Any suggestion/solutions will be apprieciated.
rgds
Fyp2001

Lord Iceman
03-05-2001, 11:47 AM
I am creating 3d editor and it has flat grid, where the user can draw a point and here is my mouse cross moving on the grid and only on the grid(it's 2d) , mousex and mousey are mouse position on the screen with hieght of winheight and width of winwidth

glTranslatef(mousex/winheight*3-2,0,mousey/winwidth*5.35f-2);
glBegin(GL_LINES);
glVertex3f(-0.1f,0,0);
glVertex3f(0.1f,0,0);
glVertex3f(0,0,-0.1f);
glVertex3f(0,0,0.1f);
glEnd();