Just how can one accurately calculate normals? I still have no clue. I'm no math wiz, I slept through my last year of math because I didn't need the credits…actually I even drew a 30 some odd page comic about a cow druid in my graphing book for math, but thats another story…
So far I'm just using simple squares to create maps in my previously mentioned 3d-sidescroller map maker and decided instead of tweaking the normal values until they look good in all ways of light that I would use one of those normal calculating examples. Naturally I would assume better results since my floors are still slightly off, but heres what happened:Heres how things look with normals manually added.http://64digits.com/users/Scott_AW/my_normals.jpgHeres what happend when I attempted to use a normal calculating code.http://64digits.com/users/Scott_AW/example_normals.jpgMy assumed normals for a fore facing wall. d3d_model_primitive_begin(global.model_basic[0],pr_trianglestrip);
{
d3d_model_vertex_normal_texture(global.model_basic[0], 0, 0, 0, 0,-1, 1/4, 0, 0);
d3d_model_vertex_normal_texture(global.model_basic[0],64, 0, 0, 0,-1, 1/4, 1, 0);
d3d_model_vertex_normal_texture(global.model_basic[0],64, 0,64, 0,-1, 1/4, 1, 1);
d3d_model_vertex_normal_texture(global.model_basic[0], 0, 0,64, 0,-1, 1/4, 0, 1);
d3d_model_vertex_normal_texture(global.model_basic[0], 0, 0, 0, 0,-1, 1/4, 0, 0);
}
x1 = argument0;
y1 = argument1;
z1 = argument2;
x2 = argument3;
y2 = argument4;
z2 = argument5;
x3 = argument6;
y3 = argument7;
z3 = argument8;
crossX = (y2-y1)*(z3-z1)-(y3-y1)*(z2-z1);
crossY = (z2-z1)*(x3-x1)-(z3-z1)*(x2-x1);
crossZ = (x2-x1)*(y3-y1)-(x3-x1)*(y2-y1);
length = sqrt(sqr(crossX) + sqr(crossY) + sqr(crossZ));
global.normX = crossX/length;
global.normY = crossY/length;
global.normZ = crossZ/length;
I drew superhero Log Man in my maths book.
"Hey kids! Don't do crime, you nazi bastards!"I think you should clarify to most members here, that you mean mathimatical normals, and not simply a "who can say what is normal?" comment. =P
Its a play on words, is that so bad?