Applying a texture to a complex TriMesh

Hi everyone,

I created a complex TriMesh purely in code, once it was created I used NormalGenerator to find the normals for the model so lighting would work properly. The problem now is that I can't find anything similar to generate the coordinates for the texture placement.

Thanks

I think that's difficult (but not impossible). I'm not much help other than to ask why you chose a code implementation when modeling tools would help you do this? Just curious.

Because the only modelling software I know, Blender, has a preformance-killing glitch on my MacBook. I'm not ready to turn to piracy to model a simple space-ship just yet.



I know it isn't ideal, trust me. I was just wondering if there was something like NormalGenerator but for texture coordinates.

gbanfalvi said:

I'm not ready to turn to piracy to model a simple space-ship just yet.

I respect that.

gbanfalvi said:

I was just wondering if there was something like NormalGenerator but for texture coordinates.

Not that I know of.

But if you are familiar with the way texture coordinates work, seeing as you "designed your spaceship by hand" it think it would be trivial to lay them out, much like you did your vertices.

But if you are familiar with the way texture coordinates work, seeing as you "designed your spaceship by hand" it think it would be trivial to lay them out, much like you did your vertices.


I'm not really sure about textures. I assume coordinates work by flatly placing the texture on the triangle. The four Vector2f's represent the four corners of the texture and the top-most left-most point in the triangle is (0, 0).

If so, it would still be a nightmare. I mean, seriously, placing 400 or so polygons with loops and math functions is fine (my ship is disc shaped and not that complex), but doing the same to place a texture on all the polygons? Suicide.

edit: Is there any way to 'project' a texture on a surface? Would it kill performance?

edit 2.0: I found TestProjectedTexture, I'll try implementing that. Thanks!

Just curious… what NormalGenerator you use?



By the way… maybe you could find something here:



http://en.wikipedia.org/wiki/3D_computer_graphics_software



Edit: Fixed the link tag

You wouldn't get anywhere trying to unwrap it in jME. Blender is not the only free modeling tool, you know.