[英]3D linear surface
I need to make interpolation and build a linear surface using OpenGL, but I have a problem with algorithm.我需要使用 OpenGL 进行插值和构建线性曲面,但我有算法问题。 In my book(Rodgers Computer Graphics) is said that the equation of linear surface is Q(u,w) = P(u,0)(1-w) + P(u,1) * w.在我的书(罗杰斯计算机图形学)中说线性曲面的方程是 Q(u,w) = P(u,0)(1-w) + P(u,1) * w。 But I can`t find a way to use it.但我找不到使用它的方法。 How can I do this?我怎样才能做到这一点?
Make a grid and approximate by quads.制作一个网格并用四边形近似。
density = 0.01;
for (a = 0.0; a <= 1.0; a += density) {
for (b = 0.0; b <= 1.0; b += density) {
draw-quad(
Q(a, b),
Q(a + density, b),
Q(a + density, b + density),
Q(a, b + density));
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.