Sorry.... but i didn't find any thread concerning Fredborgs Dot3 Code....
Well i think there should be thread to comment it... so here it is ^^
The downloadlink to Fredborgs Dot3 Code
http://home1.stofanet.dk/mfredborg/DotMyBot.zip
This is damned good work... it helped me a lot to understand dot3...
But i really didn't know what to do with the part of your update-Function that should handle directional lights.
There is no bump effect.
And i couldn't see what red2, grn2 and blu2 are for...
So I changed this directional-light part a bit, so it's more useful for me... i used red2, grn2 and blu2 for this:
Well... dunno if this change is really useful...
mfg Raitsun
Well i think there should be thread to comment it... so here it is ^^
The downloadlink to Fredborgs Dot3 Code
http://home1.stofanet.dk/mfredborg/DotMyBot.zip
This is damned good work... it helped me a lot to understand dot3...
But i really didn't know what to do with the part of your update-Function that should handle directional lights.
There is no bump effect.
And i couldn't see what red2, grn2 and blu2 are for...
So I changed this directional-light part a bit, so it's more useful for me... i used red2, grn2 and blu2 for this:
Function graphics_Dot3_UpdateBumpNormals(mesh) n_surf = CountSurfaces(mesh) For s = 1 To n_surf surf = GetSurface(mesh,s) n_vert = CountVertices(surf)-1 For v = 0 To n_vert red2# = 0.0 grn2# = 0.0 blu2# = 0.0 For d3l.Dot3Light = Each Dot3Light If d3l\typ = 1 ; Directional light TFormNormal VertexNX(surf,v),VertexNY(surf,v),VertexNZ(surf,v),mesh,0 red2# = TFormedX()-EntityX(d3l\ent,True) grn2# = TFormedY()-EntityY(d3l\ent,True) blu2# = TFormedZ()-EntityZ(d3l\ent,True) d2# = Sqr(red2*red2 + grn2*grn2 + blu2*blu2) red2 = red2*d2 grn2 = grn2*d2 blu2 = blu2*d2 TFormNormal VertexNX(surf,v),VertexNY(surf,v),VertexNZ(surf,v),mesh,0 nx# = -TFormedX() ny# = -TFormedY() nz# = -TFormedZ() TFormPoint VertexX(surf,v),VertexY(surf,v),VertexZ(surf,v),mesh,0 red# = TFormedX()-EntityX(d3l\ent,True) grn# = TFormedY()-EntityY(d3l\ent,True) blu# = TFormedZ()-EntityZ(d3l\ent,True) d# = Sqr(red*red + grn*grn + blu*blu) red = red/d grn = grn/d blu = blu/d ElseIf d3l\typ = 2 ; Point light TFormNormal VertexNX(surf,v),VertexNY(surf,v),VertexNZ(surf,v),mesh,0 nx# = -TFormedX() ny# = -TFormedY() nz# = -TFormedZ() TFormPoint VertexX(surf,v),VertexY(surf,v),VertexZ(surf,v),mesh,0 red# = TFormedX()-EntityX(d3l\ent,True) grn# = TFormedY()-EntityY(d3l\ent,True) blu# = TFormedZ()-EntityZ(d3l\ent,True) d# = Sqr(red*red + grn*grn + blu*blu) red = red/d grn = grn/d blu = blu/d Else RuntimeError "Lighttype not supported!" End If dot# = (red*nx + grn*ny + blu*nz) If dot<0.0 Then dot = 0.0 red# = ((1.0+(red*dot))*127.5)*d3l\mul grn# = ((1.0+(grn*dot))*127.5)*d3l\mul blu# = ((1.0+(blu*dot))*127.5)*d3l\mul If red<0 Then red = 0 If grn<0 Then grn = 0 If blu<0 Then blu = 0 red2# = red2+red grn2# = grn2+grn blu2# = blu2+blu Next VertexColor surf,v,red2,grn2,blu2 Next Next End Function
Well... dunno if this change is really useful...
mfg Raitsun




