Skip to main content
deleted 3 characters in body
Source Link
Arjan Singh
  • 2.5k
  • 3
  • 24
  • 42

I am trying to implement the pen tool from Adobe Illustrator in OpenGL. I am trying to get the coordinates of the reverse tangent upon mouse release. I tried negating the coordinates I got upon mouse release but that doesn't seem to work.

enter image description here

void myMouse(int button, int state, int x, int y) {

int DirectionHandleX;
int DirectionHandleY;

// If left button was clicked
if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) 
{
    drawDot(x, SCREEN_HEIGHT - y);
}
else if (button == GLUT_LEFT_BUTTON && state == GLUT_UP) 
{
    DirectionHandleX = x;
    DirectionHandleY = y;
    drawDot(DirectionHandleX, SCREEN_HEIGHT - DirectionHandleY);
}

}

I am trying to implement the pen tool from Adobe Illustrator in OpenGL. I am trying to get the coordinates of the reverse tangent upon mouse release. I tried negating the coordinates I got upon mouse release but that doesn't seem to work.

enter image description here

void myMouse(int button, int state, int x, int y) {

int DirectionHandleX;
int DirectionHandleY;

// If left button was clicked
if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) 
{
    drawDot(x, SCREEN_HEIGHT - y);
}
else if (button == GLUT_LEFT_BUTTON && state == GLUT_UP) 
{
    DirectionHandleX = x;
    DirectionHandleY = y;
    drawDot(DirectionHandleX, SCREEN_HEIGHT - DirectionHandleY);
}

}

I am trying to implement the pen tool from Adobe Illustrator in OpenGL. I am trying to get the coordinates of the reverse tangent upon mouse release. I tried negating the coordinates I got upon mouse release but that doesn't seem to work.

enter image description here

void myMouse(int button, int state, int x, int y) {

int DirectionHandleX;
int DirectionHandleY;

// If left button was clicked
if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) 
{
    drawDot(x, SCREEN_HEIGHT - y);
}
else if (button == GLUT_LEFT_BUTTON && state == GLUT_UP) 
{
    DirectionHandleX = x;
    DirectionHandleY = y;
    drawDot(DirectionHandleX, SCREEN_HEIGHT - DirectionHandleY);
}
Source Link
Arjan Singh
  • 2.5k
  • 3
  • 24
  • 42

How to get coordinates of opposite direction from mouse release point relative to a point?

I am trying to implement the pen tool from Adobe Illustrator in OpenGL. I am trying to get the coordinates of the reverse tangent upon mouse release. I tried negating the coordinates I got upon mouse release but that doesn't seem to work.

enter image description here

void myMouse(int button, int state, int x, int y) {

int DirectionHandleX;
int DirectionHandleY;

// If left button was clicked
if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) 
{
    drawDot(x, SCREEN_HEIGHT - y);
}
else if (button == GLUT_LEFT_BUTTON && state == GLUT_UP) 
{
    DirectionHandleX = x;
    DirectionHandleY = y;
    drawDot(DirectionHandleX, SCREEN_HEIGHT - DirectionHandleY);
}

}