Google Answers Logo
View Question
Q: How does OpenGL do clipping? ( No Answer,   0 Comments )
Subject: How does OpenGL do clipping?
Category: Computers > Graphics
Asked by: inkyblinky-ga
List Price: $50.00
Posted: 01 Oct 2005 23:02 PDT
Expires: 31 Oct 2005 22:02 PST
Question ID: 575234
How does OpenGL do clipping?

The OpenGL spec states that vertices are clipped into the range -wc <=
xc <= wc, -wc <= yc <= wc, -wc <= zc <= wc, where wc is the clip w
coordinate, xc is the clip x coordinate, etc.

I presumed that this process was done using a 3D implementation of
Hodgman-Sutherland, but this appears to be incorrect.

I'm looking for an expert on this exact subject that can sort out my
confusion. Assume I'm implementing my own OpenGL in software.

Request for Question Clarification by maniac-ga on 02 Oct 2005 19:57 PDT
Hello Inkyblinky,

You may want to describe a little more fully "which" clipping you are
attempting to perform. The clipping done by the sample implementation
of Open GL at
is very complex (wc main/gfx/opengl/glcore/*clip* - results in 1830
lines of code). There are lots of special cases (e.g., an arbitrary
polygon being clipped against a plane, resulting in multiple polys,
different algorithms when fog is present) that may need to be
implemented - depending on your need.

Could you explain a little more fully the scope of your question so I
can prepare a proper answer based on a review of the source code.

A side question - based on the last sentence - I might ask why the
[free] sample implementation is not adequate for your needs?


Clarification of Question by inkyblinky-ga on 03 Oct 2005 13:04 PDT
I need to clip a triangle to the view volume defined by the equations
given above (e.g., -wc <= x <= wc, etc.). I'm looking for a clear
discussion of the general theory, not "this is what the opengl
reference rasterizer does." I want to understand why hodgman
sutherland and cohen sutherland both seem to be inadequate to the
task, and get a pointer to an algorithm (hopefully in Computer
Graphics, Principles and Practice) that will clip for me.

Clarification of Question by inkyblinky-ga on 03 Oct 2005 13:14 PDT
...or stated another way, how do you clip a triangle in homogeneous
coordinates to the view volume, which is also specified in homogeneous
There is no answer at this time.

There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy