使立方体成圆角

时间:2013-02-28 21:13:03

标签: javascript jquery css3 3d three.js

如何使用three.js制作带圆角的立方体?我读过它不能用css完成。有人能告诉我怎么做吗?

http://jsfiddle.net/rajkumart08/8YK2n/embedded/result/

/*
|------------------------------------------|
| MelonHTML5 - 3D Cube Gallery             |
|------------------------------------------|
| @author:  Lee Le (lee@melonhtml5.com)    |
| @version: 1.02 (09 Jan 2013)             |
| @website: www.melonhtml5.com             |
|------------------------------------------|
*/
Gallery = {
    _config: {
        speed: 500,
        size: 100,
        lightbox: !0,
        closeOnEsc: !0,
        animation: "default",
        slideshow: !1,
        slideshow_speed: 3E3,
        cube_speed: 1E3
    },
    lightbox_speed: 300,
    window_width: null,
    window_height: null,
    _cube_timeout: null,
    _gallery: null,
    _overlay: null,
    _lightbox: null,
    _current: null,
    _in_slideshow: !1,
    init: function () {
        Gallery._buildContainer(!0, !0);
        Gallery.window_width = $(window).width();
        Gallery.window_height = $(window).height();
        $(document).keydown(Gallery.Events.keyDown);
        $(window).resize(Gallery.Events.windowResize);
        Gallery._startCube()
    },

1 个答案:

答案 0 :(得分:1)

这是一个使用细分修饰符的three.js代码示例的链接,它将生成一个圆角的立方体。

http://stemkoski.github.com/Three.js/Subdivision-Cube.html