This gives bad and evil and horrible results. Does anyone have a function to adjust vertex colors according to the normal, to display a regular bump map on walls?
I think the blue value controls the lightness/darkness of the surface, and the red and green values control the x/y vector. However, I can't translate this into results that looks like anything.
I think the blue value controls the lightness/darkness of the surface, and the red and green values control the x/y vector. However, I can't translate this into results that looks like anything.
Function NormalMapMesh(mesh,recursive=True) temp=CreatePivot() RotateEntity temp,45,35,0 If EntityClass(mesh)="Mesh" For s=1 To CountSurfaces(mesh) surf=GetSurface(mesh,s) For v=0 To CountVertices(surf)-1 TFormNormal VertexNX(surf,v),VertexNY(surf,v),VertexNZ(surf,v),mesh,temp r=1.0-(TFormedX())*128.0+128.0 g=(TFormedY())*128.0+128.0 b=(TFormedZ())*128.0+128.0 VertexColor surf,v,r,g,b,VertexAlpha(surf,v) Next Next EndIf If recursive For c=1 To CountChildren(mesh) normalmapmesh GetChild(mesh,c),True Next EndIf FreeEntity temp End Function



