#### Archived

This topic is now archived and is closed to further replies.

# Backface Culling

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

## Recommended Posts

hello there, im using Mark Morleys code for bounding sphere occlusion and it works great however i am now implimenting backface removal and for some reason its not working. Im doing the following Get the clip planes for the frustum ( these all face inwards ). ViewNormal = 1st 3 elements of near clip plane (x,y,z). Multiply the quads normal by the objects current transformation matrix. If DotProduct(ViewNormal,QuadNormal) > 0 then RenderQuad. Can anyone see anything obviously wrong, Thanks Mark.

##### Share on other sites
Let me try to draw some art:
^
| /
| |
| /
|
*
Well... * is the eye position, the arrow your ViewNormal and the other thing a quad.
Clearly, the quad´s normal is facing in the direction of the ViewNormal, even though the quad is possibly visible (Draw this clearly on a piece of paper, and you will see what I mean).
But you can adjust this simply. Just take any point on your quad. Let´s call it a. Then calculate
ViewNormal = a - eyePosition

I now see something else that could be wrong. You must take care that you multiply the quad´s normal with the linear part of your transformation matrix (no translation). As you only want to rotate the normal, not translate it. So make the fourth row (or column, depends on your math) 0.

##### Share on other sites
Cheers,

shall give that a go,
normal ( specular highlights wizzing around with
object as it rotates ) All fixed now

Many thanks

Mark.

1. 1
Rutin
23
2. 2
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 15
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631757
• Total Posts
3002150
×