问题描述
我使用什么函数/数学来绘制 3d 表面?例如,我如何生成 z = sin(x+y)?点是如何计算和绘制的?我找不到任何示例.
What functions/math do I use to draw a 3d surface? For example, how do I generate z = sin(x+y)? How are the points calculated and drawn? I couldn't find any examples.
推荐答案
https://threejs.org/docs/#api/en/geometries/PlaneGeometry
像这样的东西包含顶点.如果一个顶点由 [x,y,z] 组成,您可以通过循环遍历所有顶点来在那里应用您的函数.
Something like this contains vertices. If a vertex consists of [x,y,z] you can apply your function there by looping through all the vertices.
http://aerotwist.com/tutorials/an-着色器介绍-第 1 部分/
本教程是一个示例,说明如何使用着色器更快地完成相同的事情
this tutorial is an example how you can use shaders to do the same thing MUCH faster
我相信本教程是所有实时 3d 事物的绝佳起点:http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/
I believe that this tutorial is a great starting point for all things realtime 3d:http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/
这篇关于如何使用three.js绘制自定义3d表面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!