Help with Lambert shading
Help with Lambert shading
Hi, its Mit, for some reason I'm having a real difficult time with Lambert shading, I can program (rotate, translate, project, sort, find normals, and fill) in 3D but the Lambert shading is getting at me. All the colors get messed up when I try it. I've look at many tutorials and sawt help online, but this is my last choice to find out on how to put Lambert in my sick program (accualy its not that sick because this is my "trial program" or first program for 3D stuff). Ok so here are my specific questions (if they weren't ovious already):
1) How do you define a light sorce
2) How do you find and rotate the normals for the polys
3) How do you use 1 and 2 above to find the intensity of each color(intensity of each color is on a 0 to 15 scale)
This is a VERY difficult topic and I would really appreciate it if anyone would reply expecialy those who know what they are talking about
Thank You
-Mit
1) How do you define a light sorce
2) How do you find and rotate the normals for the polys
3) How do you use 1 and 2 above to find the intensity of each color(intensity of each color is on a 0 to 15 scale)
This is a VERY difficult topic and I would really appreciate it if anyone would reply expecialy those who know what they are talking about
Thank You
-Mit
Hi,
Feel free to still answer this question,
but I decided to not put lambert shading
in my program. But I would Still appresiate it
if someone would answer for any possible future programs...
I know there is no easy answer for this but the tutorials
I looked at were no help, so even if you don't want to answer to this,
instead, if you could point out a helpful tutorial on it that would be great.
thanks,
-Mit
Feel free to still answer this question,
but I decided to not put lambert shading
in my program. But I would Still appresiate it
if someone would answer for any possible future programs...
I know there is no easy answer for this but the tutorials
I looked at were no help, so even if you don't want to answer to this,
instead, if you could point out a helpful tutorial on it that would be great.
thanks,
-Mit
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
No, I haven't but I will try.
Thanks for the adivice.
-Mit
P.S. I never expected you to know about it anyway,
not many programmers accually get involved in it
now a days. I'm just a little crazy for trying this 3D
in QB also, the SLOWEST of all languages (Something to do with DOS... )
but I like QB and its fun. Oh yeah, I'm not saying that as a bad thing but
thanks for replying.
Thanks for the adivice.
-Mit
P.S. I never expected you to know about it anyway,
not many programmers accually get involved in it
now a days. I'm just a little crazy for trying this 3D
in QB also, the SLOWEST of all languages (Something to do with DOS... )
but I like QB and its fun. Oh yeah, I'm not saying that as a bad thing but
thanks for replying.
Here:
http://rel.betterwebber.com/junk.php?id=21
Read chapter 3, example is in the examples folder.
Chapter 5 is in this site as an article.
http://rel.betterwebber.com/junk.php?id=21
Read chapter 3, example is in the examples folder.
Chapter 5 is in this site as an article.
Its Rel, as in Relsoft?
If it is, your arcticles were most helpful for a person like me who has
no experiance in Trig, and were the main arcticles I looked at.
The Lambert shading confused me on those though.
If those are the same articles that I've seen on this site then I've already
seen them and are still confused. Sorry about that.
-Mit
If it is, your arcticles were most helpful for a person like me who has
no experiance in Trig, and were the main arcticles I looked at.
The Lambert shading confused me on those though.
If those are the same articles that I've seen on this site then I've already
seen them and are still confused. Sorry about that.
-Mit
Yep, I'm Relsoft, just a il lazy to type my whole nick .:*)
Yes, they're the same. What problem with lambert are you having?
If it's calculating the face normals, just get 3 points off a face and calculate the normal by using the cross product. Then normalize your normal by dividing it by its length.
After that you multiply that normal with 255 to get the color of the face. Be sure to make your pal a gradient from dark to bright.
Yes, they're the same. What problem with lambert are you having?
If it's calculating the face normals, just get 3 points off a face and calculate the normal by using the cross product. Then normalize your normal by dividing it by its length.
After that you multiply that normal with 255 to get the color of the face. Be sure to make your pal a gradient from dark to bright.
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Or try mine: Mitth'raw'nuruodo
But never mind that.
I don't understand the 3 points of the light vector,
I mean where the light sorce will show from with different points.
I didn't gradient my palette, mabey thats the problem so i'll try that.
Now when multipling the norm by the color range how does that
get a specific color I want?
Oh yeah, how does the light vector come in to these equations?
Well those are my questions for you as you requested.
-Mit
But never mind that.
I don't understand the 3 points of the light vector,
I mean where the light sorce will show from with different points.
I didn't gradient my palette, mabey thats the problem so i'll try that.
Now when multipling the norm by the color range how does that
get a specific color I want?
Oh yeah, how does the light vector come in to these equations?
Well those are my questions for you as you requested.
-Mit