生成网格 [英] Generate grid mesh

查看:18
本文介绍了生成网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个四边形网格,这样我就可以在 X 和 Y 上拥有 200x200 的顶点和从 0 到 1 的 UV 坐标.

I need a mesh of quads so I can have 200x200 vertices and UV coordinates from 0 to 1 in both X and Y.

我不能手写,有什么办法可以生成这样的网格吗?

I can't write this by hand, any way to generate such a mesh?

推荐答案

您可以使用循环来创建此顶点数组.简单:

You can use loop to create this vertices array. Simple:

for (var i = 0; i < 200; i++)
  for (var j = 0; j < 200; j++)
  {
   // fill our array here
  }

这篇关于生成网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆