我正在为 iPhone 创建一款骰子游戏。我使用 SIO2 作为引擎,但我认为这个问题与 OpenGL 相关更一般。
由于 iPhone 缺乏抗锯齿支持,我的骰子看起来有点前卫。如果可能的话,我想让模具的边缘变得圆润光滑,而不是锋利的。我发现一个应用程序 MotionX 可以做到这一点,而且我认为无需使用抗锯齿功能。请参阅此处的屏幕截图。如果仔细观察骰子边缘,您会发现从明亮的顶面到阴影侧面有一个浮动过渡。这个从远处看有点圆。
有谁知道如何重现这样的效果?
I'm creating a dice game for the iPhone. I'm using SIO2 as engine, but I think this question is more general OpenGL-related.
Since the iPhone lacks support for anti-aliasing, my dice looks kind of edgy. If possible, I'd like to make the edges of the die rounded and smooth instead of sharp. I've found one app, MotionX, that manages to do this, and I think without using anti-aliasing. See screenshot here. If you look closely at the dice edges, you see there is a floating transition from the brightly lit top face to the shadowed side face. This looks kind of round from far away.
Does anyone know how to recreate such an effect?
发布评论
评论(2)
您需要创建边缘和角稍圆的骰子。这样每张脸之间就不会出现急剧的过渡。
如果您的建模包可以创建它们,您可以使用 Superquadrics 来创建此类模型。您可以更改方程的参数来产生效果。
请参阅 上的左上图此图片
(来源:free-online.co.uk< /a>)
You need to create the dice with slightly rounded edges and corners. That way there won't be a sharp transition between each face.
If your modelling package can create them you could use Superquadrics to create this sort of model. You can change the parameters of the equation to produce the effect.
See the top left figure on this image
(source: free-online.co.uk)
不确定 iPhone 是否支持此功能,但您也许可以使用法线贴图实现此效果:
< a href="http://en.wikipedia.org/wiki/Normal_mapping" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Normal_mapping
当然,你需要截断角,使它们足够圆,这样法线贴图就能完成剩下的部分。
Not sure if the iPhone supports this, but you may be able to achieve this effect with a normal map:
http://en.wikipedia.org/wiki/Normal_mapping
Of course, you'll need to truncate the corners to get them sufficiently round enough that the normal map will get you the rest of the way.