Normalising UV Maps

Blitz3D Forums/Blitz3D Programming/Normalising UV Maps

TeraBit(Posted 2003) [#1]
Any thoughts on a good way to normalise UV maps.

i.e. Say you have UVs which are less than 0 and more than 1 in certain places, making sure they all fit in a 0..1 texture area!

I have tried a few ways, but it's hard to tell when something is just over the edge of a UV boundry by accident, or if it is an attempt to tile the texture!


jfk EO-11110(Posted 2003) [#2]
What kind of accident could this be?


fredborg(Posted 2003) [#3]
Assuming this is for Tattoo, why not just ask when the model is loaded?


TeraBit(Posted 2003) [#4]
Well, sometimes in Lightwave when you do a UV map, one edge will be poking out of the texture space. I've been caught out by this on a couple of occasions.

I could ask when loading, but I already ask about missing textures (although you can turn this off now if you like) and it could well be both (some UVs are tiled while others are just misaligned).

The workaround I'm using at the moment is:

Function Range#(JIM#)
 If jim<0 And Abs(jim)<0.1 Then Return 0 ; if just a little over
 If jim>1 And Abs(jim)<1.1 Then Return 1 

 If jim<0 Then jim = (1+jim) ; Untile it
 If jim>1 Then jim = jim - Floor(jim) ; Untile it
 Return jim#
End Function


Which assumes that accidents will be little. It works quite well so far.


dmoc(Posted 2003) [#5]
Lee, good luck with Tattoo, I'll probably buy it on my next spending spree! Are updates free?

Re your problem, I don't have a solution but, if you haven't already, maybe you would like to consider a "project settings" file? This would allow you to prompt the user once only where needed and/or have a customisable "default settings". Just a thought.


TeraBit(Posted 2003) [#6]
Hi dmoc,

Yup updates are free for all Tattoo 1.x versions. Project settings are a neat idea, but often your work will follow a set pattern anyhow, so might not be as useful as the global settings. I'll have to see how that goes really. :)