This week I went to help a friend with building a new house. This friend is very good at 3D programming. During the work we discussed our project, especially the problem with lighting. I used the PositionTexture user difined Class to define and draw the string. This has leaded to a problem that the primitives have no information of the normal of each point so that it's looking like half lit and half dark. I used this PositionTexture class simply because I have not come out the method to calculate the normals for each point. My friend pointed out that I can actually use the central point on the curve to get it done, that is curent_point_on_circle - (minus) central_point is a vector which can be normalised to be exactly the normal of that point. This idea is so good, simple and it works. Now I've used the PositionNormalTexture Class and set up each point to have information about its postion, information of its texture coordinate, and the info of its normal. This change has given us a very nice looking string. It looks so real. I love it. The attached photos show the current effect of a string with different color in a scene.




No comments:
Post a Comment