zoukankan      html  css  js  c++  java
  • 如何在三维坐标中选择点

    简介

    如何在三维坐标中选择点是一个非常非常有用的操作。

    code

    void pick_point(int x, int y, double p[3])
    {
    	GLint viewport[4];
    	glGetIntegerv(GL_VIEWPORT, viewport);
    	GLdouble winX = double(x);
    	GLdouble winY = double(viewport[3] - y);
    	GLfloat winZ = 0.0;
    	glReadPixels((int)winX, (int)winY, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ);
    	gluUnProject(winX, winY, (GLdouble)winZ, modelview_matrix_, projection_matrix_, viewport, &p[0], &p[1], &p[2]);
    }
    

    参考链接

    https://blog.csdn.net/donglei2007/article/details/7868229

    Hope is a good thing,maybe the best of things,and no good thing ever dies.----------- Andy Dufresne
  • 相关阅读:
    Python
    Python
    Python
    Python
    Python
    Python
    Python
    python
    对象
    py常用模块
  • 原文地址:https://www.cnblogs.com/eat-too-much/p/13935339.html
Copyright © 2011-2022 走看看