three.js: rendering 3d text with custom texture

时间秒杀一切 提交于 2019-12-11 08:15:34

问题


I've been wondering is it possible to do skinning to the 3d text with loaded images as texture? I knew you could do it with cubes and others since most of the sample were showing tutorials how to do it.

What did I tried was map it with THREE. ImageUtils.loadTexture directed from the path but what did i get is some transparency object. I wonder how to use the same concept such as:

 CubeGeometry(width, height, depth, widthSegments, heightSegments, depthSegments, listofmaterials) 

in TextGeometry since TextGeometry( text, {parameters} ).

It might be possible we have to do it for every sides using https://github.com/mrdoob/three.js/issues/1318 as guidelines.


回答1:


Here is an example of 3D text with a texture applied:

http://stemkoski.github.io/Three.js/Text3D-Textures.html

Hope it helps!




回答2:


TextGeometry doesn't provide UV coordinates and if you think a bit it would be really hard to abstract that process and serialize it for any text geometry. Text is yet another form of custom mesh, therefore, you would have to provide textureCoord attribute manually and use ShaderMaterial to sample textures. Hope this helps.



来源:https://stackoverflow.com/questions/16807184/three-js-rendering-3d-text-with-custom-texture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!