admin管理员组文章数量:1292809
I'd like to draw a Rubik's Cube on html canvas element with some perspective, but I've never had any experience with 3d graphics, perspective etc. so I'm looking for all helpful resources to achieve this. The only helpful link I've found is for this demo :
.html
I'd like to draw a Rubik's Cube on html canvas element with some perspective, but I've never had any experience with 3d graphics, perspective etc. so I'm looking for all helpful resources to achieve this. The only helpful link I've found is for this demo :
http://oos.moxiecode./js_canvas/3d_cube/index.html
Share Improve this question edited Nov 17, 2012 at 21:04 HostileFork says dont trust SE 33.6k13 gold badges102 silver badges174 bronze badges asked Sep 16, 2011 at 22:18 mike_hornbeckmike_hornbeck 1,6223 gold badges30 silver badges52 bronze badges 1- There are some Java applets around that can draw isometric Rubik's Cubes that might help. – Neil Commented Sep 16, 2011 at 22:33
2 Answers
Reset to default 9You can certainly create 3-d models with canvas using webGL or 3-d javascript libraries, but I would personally use CSS3 transforms and translations instead if you're wanting to create a rubix cube (I promise, it would be MUCH LESS code). Check this out and you'll be inspired:
http://www.paulrhayes./2009-07/animated-css3-cube-interface-using-3d-transforms/
This demo is using linear rotations, but if you use ease-in-out rotations, the rotations will look much more natural.
I wrote this awhile back
http://www.pascarello./canvas/rubikscube/
It has issues when you start to mix up colors, but you can play with the code.
本文标签: javascriptBasics of 3d to draw Rubik39s CubeStack Overflow
版权声明:本文标题:javascript - Basics of 3d to draw Rubik's Cube - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741561947a2385498.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论