Sign in to follow this  

GDI+ simulating light, color values

This topic is 4780 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i'm working on a vrml viewer with gdi+. now i have the problem with calculating the different lightvalues for my object. when i paint all the polygons with all the same color you can't see anything of 3d. it all looks like a 2d shape filled with one color. hope u know what i mean. now i'm calculating the normals, get the x value and the arcus cosine of it. then i multiply it with a fixed value to get a result beween 0 and 255. my code looks like this: int blue_value = (int)(Math.Acos(face.normal.x) * 81.16; then i'm just taking the original red and green values and the calculated blue value for my brush color. this works fine with only a few clear colors like blue with rgb(0,0,bluevalue), but it starts to look totally bad with more different colors, especially with not clear red, green or blue values. then the calculated color turns from e.g. blue to green etc. hope u know what i mean. has anyone a good idea to calculate the different values for a color, without gettin these results?

Share this post


Link to post
Share on other sites

This topic is 4780 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this