mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
101.55k stars 35.29k forks source link

Cube with rounded corners #894

Closed drsagitn closed 12 years ago

drsagitn commented 12 years ago

Hello everyone,

Could we create a cube with all of it corners rounded? Or is there any example about this.

Thanks very much!

alteredq commented 12 years ago

There is subdivision:

http://mrdoob.github.com/three.js/examples/webgl_geometry_subdivison.html

Also maybe this could be used:

http://chandler.prallfamily.com/2011/12/constructive-solid-geometry-with-three-js/

drsagitn commented 12 years ago

Thank you! The first example is something I'm looking for. But can we achieve it without WebGL? I would like to use Canvas only to create cubes like that.

alteredq commented 12 years ago

Subdivision should work also with CanvasRenderer, just performance will probably be quite bad.

drsagitn commented 12 years ago

Ok, I'll check it out. Thanks very much!

dmauro commented 11 years ago

Hi, it looks like SubdivisionModifier has been removed (https://github.com/mrdoob/three.js/commit/21d0796996215e1c310a254fe444aea3bc91a87b) recently. What's the best way to try to get rounded cubes?

tr00per commented 11 years ago

It's still there - examples/js/modifiers/SubdivisionModifier.js. Also you can export your desired geometry from Blender.

dmauro commented 11 years ago

But when using the latest build of three.min.js, THREE.SubdivisionModifier is undefined.

mrdoob commented 11 years ago

Moved SubdivisionModifier out of the build to examples/js/modifiers.

<script src="../build/three.min.js"></script>
<script src="js/modifiers/SubdivisionModifier.js"></script>