PDA

View Full Version : Move a point with rendered axis



jafrbc
04-17-2014, 06:58 AM
Hi there,

Suppose I have a point I want to move (translation + rotation). For now I'm just using keyboard. Do you know some tutorial to perform the same operation but with the axis that you can often see in several mesh viewers? Thanks a lot.

fiodis
04-17-2014, 08:47 AM
If I'm understanding it right, you're asking how to render the axis and manipulate it by clicking and dragging? If so, then you can render the set of axes as GL_LINES primitives and multiply them by the same model matrix you use for the point. (Assuming your translations/rotations are operating on the model matrix rather than the point directly.) And to do the clicking and dragging, take a look at this set of tutorials (http://www.opengl-tutorial.org/miscellaneous/clicking-on-objects/) on picking. There are others out there too, of course.