我正在尝试实现射线拾取算法,用于绘制和选择块(因此,我需要相当数量的准确性)。最初,我使用了一个光线投射实现,但我觉得它不够准确(尽管故障可能与我的交叉测试有关)。无论如何,我决定尝试使用深度缓冲区来选择,并将鼠标坐标转换为世界坐标。执行情况如下:
glm::vec3 Renderer::getMouseLocation(glm::vec2 coordinates) {
float depth = deferredFBO->getDepth(coordinates);
// Calculate the width and height of the deferredFB
我试图用一个基于web的应用程序来表示正在钻的一个洞,而且我遇到了困难。我控制着输入和各种变量,但不确定如何最好地处理这个问题。
模拟目前有这些值,它们仅用于测试目的。
Radius of drill bit= 15
inches Length of drill = 1000ft
RPM of drill = 100
地层层有自己的属性,在这种情况下有:
Name = bla
Depth = 100ft (models start and finish of each layer - here, 0 to 100ft down)
Permeability = 10 (currently