Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question

2 Answers

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.

share|improve this answer
Thanks for your reply. I'm still having no luck on solving it. May i ask for simple examples? Or any snippets flow assistance might be good. I'm quite new to this, sorry for asking such a silly question. – user2430990 May 29 at 14:40
Create ShaderMaterial, add custom attribute for UV for certain text geometry. Basic usage of ShaderMaterial you can see here: blog.cjgammon.com/?p=392 So for each vertex of the geometry you would add its texture coordinate and use simplest fragment shader that would sample texture based on the texture coordinate. Instead of doing this job manually, I would suggest that you make a model, texture it and just load it. Either way done it won't be dynamic and changeable depending on the text content for example unless you make a model per letter. Hope this helps. – Abstract Algorithm May 29 at 17:05
Of course there was an alternative way to solve it, by the time i'm stuck with this i've been thinking about COLLADA loader which is the way you did mentioned. But what i'm trying to approach might be something more on optimization on web publishing materials since animated sequences is quite heavy loading. Anyway, thanks for your precious time of trying to explain to me how it works. – user2430990 May 29 at 17:37

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

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

Hope it helps!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.