0

如何在 iOS 的 openframeworks 中构建 3d 钻石?我很难在 openframeworks 中找到有用的 3d 渲染教程,而且我来自 Processing。

4

1 回答 1

3

I think there are two sides of the story:

  1. the nerdy openframeworks/c++/gl part part: how do you actually render a mesh of triangles together
  2. the fun part: geometry

For the 1st part I recommend starting with the oF documentation on ofVbo. The article shows you how to render an icosahedron which with flat shading (and optionally perhaps basic subdivision) can look like a diamond

ofVbo

The point is you need to get used to working with vbos, vertices and faces. Once you've got the hang of that you can explore geometry

You can work out the indices to draw a common diamond (using the polar to cartesian formula and a bit of offsetting/scaling):

diamond

Or you can explore geometry further by looking at:

  • platonic solids (see icosahedron/dodecahedron)
  • archimidean solids
  • polar zonohedron maybe ? (I played with this a bit in Processing porting Rob Bell's Polar Zonohedron free Sketchup Ruby Script, plenty of interesting geometry on his site)

If you have the time also explore resources from geometers like Paul Bourke or George Hart

于 2013-04-01T22:16:26.380 回答