looks like my texturemapper still needs to be moderated, you know me im a "prinzipienreiter" someone who cares a lot (we care a lot ...) aboout the basic understanding of a topic, it's something this button presser generation leaks strongly of.
i found a very deep explanation to 3D view and UV mapping in "Google Books", for those who like to get deeper knowledge about this as just to fiddle around with a software which won't tell you the rules that stand behind.
however i did that in advance all myself and to create something like a texturemapper i had to know how the tard works. most i knew already but there was still some questions i couldn't have answered before i made some test models. the starting point for my texmapper was Tom "noflag" Morton's (noflag is very important to me

) "cuboid" function. I extended this function to a textured cuboid which will be textured automatically from all sides with the same texture (instead of a lousy diagonal projection which is still handy in some cases).
remember this tard is all out of my shitty brain, i have no web at home where i could have referred to something like the above link. +---+---+ +------ / + + + +-----+ +-----+ +------ +-----+ | | / | /| / | | | | | | | | +---- / | / | /___ +-----+ +-----+ +---- +-----+ | | / | / | / | | | | | +------ / | | / | | +------ | =================================================================================== THIS IS SUCH AN IMPORTANT FUNCTION THAT I DECIDED TO PUT IT IN A SEPERATE FILE (should have done this a long time ago)
INPUT
-----
- position & size of the geometry on which the texture will be projected on
- projection = view plane - side from which you look at the geometry, v(0,1,0) = top (bottom), v(0,0,1) = back (front), v(1,0,0) = right side (left side)
- divisor, correctional vector either to repeat a texture i.e. v(1.5,1,1) to tile it 1.5 times along "x", or to adjust the result if the size doesn't exactly fits
OUTPUT
------
a table which contains the three vectors for the texture projection
why didn't use the texture() function rightaway?
just because

just because it allows to store the vectors as a variable and
reuse them in the script if needed and foremost this allows manual tuning and if i
output the fished call for the texture function you can't do such.
USAGE
----- +----------------------------------------------------------------------------------------+ | | | local front = texmapper( position, size, v(0,0,1) ) | | texture( 'texturepath', front[1], front[2], front[3] ) | | | +----------------------------------------------------------------------------------------+
THEORY
------
a texture is always 1 in relation to the geometries dimensions. to calcultae the factor
to scale a geometry on any texture no matter what size or aspect it has we have to divide
1 with the dimensions of the geometry we like to project the texture on, resp. project the
mesh on the plane of view).
this wil strech a texture sometimes so much it turns out quite ugly
to keep a texture in it's aspect & size (repetive use of the texture) we must recompensate
this default behaviour by multiplying the resulting scale with the models dimension
so it turns back to the original size in relation to the texture.
the use varies, often you simply like to project atexture on a couple of geometries.
SCHEMA
------
Geometry (righthanded): +y | | | front/back | side 0---------- +x / / top/bottom / +z
Texture plane (righthanded): +V +---------+ UV max | | | | | | | | UV min 0---------+ +U
though....
one likes to map a geometry on a texture map which contains different textures for
the model(s).
TEXTURE DIMENSIONS
------------------
if you have a special texture map or need
to project the mesh on a given section in the texture you need to precalculate
the correctiomnal values for the position of the mesh and its size in relation
to the textures dimensions.
i didn't liked to implment this function in the mapper, it's fine for 'everyday use'
it's a quite simpler explanation as to read a book, of course you won't have deep understing after my explanation but it will make you clear why certain things are as they are.
btw, it's possible to use this function also for texture maps which contain different textures for various parts/viewplanes. i wasn't sure how and if when i wrote it and wrote also a second function the "texture calculator" it didn't turned out well and thus i returned to my mapper an i experienced it's suitable also for this task.
i didn't expect that the interest will be big in this but i'm very proud of what i elaborated myself.
finally a picture which i already posted (but i unfortunately made a mistake with the labelling, at 6:00 am after a 24h session your brain starts to get very tired)
i guess the picture tells more as a thousend words you can lose about this topic.