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

## Recommended Posts

I have read the following post and have some problems that I would like to ask. http://www.gamedev.net/reference/articles/article1088.asp int i; Vector normal, // the polygon normal camera(0,0,0), // the camera at 0,0,0 cv; // the camera vector (or view vector) // Loop through all the polygons for(i = 0; i < faces; i++) { // Transform our normal to view space... // This example assumes you've already precalculated the normal and // so all you must do is rotate it into world space by your matrix. // See my vector tutorial on how to calculate a polygon normal. normal = *face.normal; normal = normal * to_world_space; // Now calculate a vector from the camera to any point on the polygon cv.set(camera, world_space[ face.vertex[0] ] ); // Now calculate the dot product of the normal and the camera vector if((cv.dot(&normal) > 0)) { // draw the polygon here, it's visible } } I wonder how can I get the "to_world_space"? and world_space[ face.vertex[0] ] )? ( how to change the face's vertex to world space?) Can you give me some example? And how can I change the points of a Mesh that I read from .obj or .off to World Space? Actually, I am not very familiar with transforming something to World space and then to Camera space. Can you give me some example as well. Thanks.

##### Share on other sites

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

This topic is now closed to further replies.

1. 1
2. 2
Rutin
22
3. 3
4. 4
khawk
14
5. 5

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633743
• Total Posts
3013643
×