Sign in to follow this  
maya18222

Help with Quake Bezier Patches

Recommended Posts

maya18222    194
Ive trying to read in a quake 3 BSP file. And have successfully managed to get most of it working. Im currently stuck with the mesh patches bit. According to this they should be used as 3x3 bezier patches. So when reading a 5x5 patch im supposed to treat it as 4 3x3's. 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 which would then be .. 01 02 03 | 03 04 05 06 07 08 | 08 09 10 11 12 13 | 13 14 15 -------------------- 11 12 13 | 13 14 15 16 17 18 | 18 19 20 21 22 23 | 23 24 25 But Im not sure how this is going to work. If i treat them separatly like that, when putting them back togeather the curves arent going to flow. Am I supposed to be calculating the patch as a whole instead? Im not sure how to do that. Ive only coded 3x3 and 4x4 patches, as the tutorials I found only told you how to code Quadratic and Cubic Bezier's. From wikipedia, they mention using the Bernstein polynomial to calulate a bezier with any number of control points, using :- How do I code that? Edit : Shortly after posting this, I think I misunderstood the link. When they said treat it as a 3x3, I take it they meant figure out which 3x3 the point in question is enclosed in, in the 5x5, and just compute the point in said 3x3. [Edited by - maya18222 on February 11, 2010 8:46:30 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this