绘制具有平滑边缘的立方体的最佳方法? Bezier曲线,加载.3ds或其他? [英] Best way to draw a cube with smooth edges? Bezier Curve, load a .3ds or other?

查看:344
本文介绍了绘制具有平滑边缘的立方体的最佳方法? Bezier曲线,加载.3ds或其他?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用openGL在C ++中创建一个具有光滑角和多边形的立方体。
为所有我知道我有三个选项:贝塞尔曲线(也许,是可能吗?),一个立方体与圆柱体的边缘和球体的角落或加载一个立方体的.3ds。

i need to make a cube with smooth corners and smooth edges in C++ with openGL. for all i know i have three options: Bezier curves(maybe, is it possible?), a cube with cylinders for edges and spheres for corners or load a .3ds of a cube.

任何想法?

推荐答案

您可以通过直接指向法线从中心(模拟一个8角的球)。这完全取决于你正在做什么。使用上述方法可能完全够好。

You can simulate a cube with smooth lighting by pointing the normals directly out from the center (simulating an 8 cornered sphere). It totally depends on what exactly you are trying to do. Using the above method may be perfectly good enough.

如果您要定义一个带有弯曲角的立方体(向上),那么您将必须细分立方体。事实上,如果你细分角落,但忽略平面,你会得到一个很好的效果。

If you want to define a cube with curved corners (up close) then you are going to have to subdivide the cube. In fact if you subdivide strongly around corners but ignore the flat faces you will get a good effect.

所有这一切都在考虑如何在边缘细分。想想你如何能够平滑它,你一定会得出一个很好的解决方案:)

All it comes down to is thinking about how you subdivide at edges. Think about how you could smooth it out and you'll, surely, come up with a fine solution :)

这篇关于绘制具有平滑边缘的立方体的最佳方法? Bezier曲线,加载.3ds或其他?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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