Trying to paint my self made 3d mesh

Blitz3D Forums/Blitz3D Programming/Trying to paint my self made 3d mesh

Hardcoal(Posted 2016) [#1]
Hi Guys..

Ive created a 3D mesh by using Vertix and Triangles.. (obviously)
The mesh has only one surface..

I fail to paint it with a texture..
Ive Tried loadBrush, Ive tried loading texture and than applying it into a brush..
(the texture loads fine..)

all seems fine..

but instead of seen the texture i see just one dominating color from the loaded picture.
i thought maybe its an issue of scale.., but scaling the texture didnt help.

is there something i need to do after creating a mesh with one surface that i dont know about?

if i create a cube with the command createcube than apply the texture on it.. it works fine.
but my own made mesh it doesnt work.

meanwhile.. regards.. :)


RemiD(Posted 2016) [#2]
It sounds like your surface is not uvmapped... So all vertices have the same u,v coords on the texture so they are all colored by the same texel...

You need to unwrap, texelsfill, uvmap the triangles that you want to color with your texture, then export the mesh. You can use Fragmotion to do that.

A lazy notoptimised approach is to code a procedure to auto unweld the triangles of your surface, then auto texelsfill the triangles with a specific texel size, then auto uvmap the vertices, then you will be able to 3d paint on it. (that's what "lightmappers" do)

An alternative to color a mesh, is to not use a texture and to use several materials/brushes to color it, or to use several parts and vertices colors to color it...

you may be interested in this : http://www.blitzbasic.com/Community/posts.php?topic=106733


Hardcoal(Posted 2016) [#3]
Tnx Mr RemiD for your help, I will check this threw..
You gave me a direction although I know nothing of uvmap or texel..
I never dealt with that.

uvmap my triangles sounds magical for me :p


RemiD(Posted 2016) [#4]
texel = pixel of a texture

unwrap = it is like cutting some edges of some triangles which are on a 3d shape in order to be able to project them on a flat 2d (texture) (in reality this rebuilds the surface and adds more vertices depending on how you have unwraped the different sets of triangles)

unweld = its is when the surface is rebuilt so that each triangle then has its own 3 vertices (=no vertices are shared between triangles) and so they can all been projected without distortion on the texture, but then you have more vertices than necessary so it is slower to render...

texelsfill = how much you scale up/down triangle(s) on your texture so that they have more/less texels in it (sometimes you want to have more details on some parts of your surface, so you need more texels, and less details on some parts of your surface, so you need less texels)

uvmap = positions of vertices on a texture, it is the u,v vertex property

uv coords = u,v position of a vertex on a texture (between 0.0 and 1.0, it is like a percentage, if the vertex is positionned at 10x,40y on a 128w128height texture, the u,v coords would be 10/128,40/128 )


Hardcoal(Posted 2016) [#5]
Thx for the elaborate explanation Remi


jfk EO-11110(Posted 2016) [#6]
there are tools to uvmap your mesh, which is a department of game design by its own. Lithunwrap for example. do this with the static mesh, then animate it eg. with Pacemaker. google for tutorials.


RemiD(Posted 2016) [#7]
You can do all of this (model, color using different materials, color using texels colors (unwrap, texelsfill, uvmap, 3dpaint), rigg, skin, animate) using Fragmotion, and the b3d exporter produces clean b3d files...


jfk EO-11110(Posted 2016) [#8]
indeed, fragmotion rocks. but the version I used had a frequent nag popup in the free/unregistered version.


RemiD(Posted 2016) [#9]

I used had a frequent nag popup in the free/unregistered version.


just buy the full version, and no more annoying pop up !