thanks phalex that trim helped me.. but i had to look on another code to se that it has to be arround 0.1.. so now it works..
and i if someone hase wonder how to apply grass texture on flat tiles and rock on ridges... here is code to do that.. it will tile a matrix that is 128x128 tiles.. try it on some matrix to see how it looks..
before i made this i alwas had some tiles badly texturized like on that pics above where u can see the grass on that ridge... now i have fixed that with diagonal checking height...
anyway.. all this is for RTS i want to make..
so if somebody can provide me with code that can handle selection of units but keep in mind that camera can xrotate too... so it is litle harder....but i know there is some talented guys in there