Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / Clipping Textures - when polygon cliping Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
michaelz

April 13, 2005, 10:46 PM

Anyone have a good way of getting the texture U,V's Coords when cliping a polygon?

Thanks

 
michaelz

April 14, 2005, 01:07 AM

I have come up with a solution to my problem.

Find the length from start point of the line segment being cliped to the point of intersection of the clipping plane and divide it by the total length of the line segment being cliped.

This give you the % of how much each end point affects the intersection point.

start point is (1-%) and end point is just %

Enjoy

Michaelz

 
Erik Faye-Lund

April 14, 2005, 07:19 AM

uhm, do you know how polygon-clipping is done at all? ;)

when clipping an edge of a polygon, you calculate a value often refered to as "t". t is allways between 0 and 1, and is the blend-factor between the two source-vertices. the resulting vertex is then calculated by v0 + (v1 - v0) * t. this is not only valid for the vertex position, but every single linear vertex attribute, including texture-coordinates, gourard-colors, etc.

hope this clarifies a bit.

 
This thread contains 3 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.