Bezier surfaces

This is a discussion on Bezier surfaces within the Game Programming forums, part of the General Programming Boards category; I'm genrating a bezier surface using a control grid of these points: (0,0,0) (1,0,0) (0,1,0) (1,1,1) And the surface should ...

  1. #1
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072

    Bezier surfaces

    I'm genrating a bezier surface using a control grid of these points:
    (0,0,0) (1,0,0)
    (0,1,0) (1,1,1)

    And the surface should be equal to z = xy. My rendering lies on z=xy, but doesn't extend to two of the control points.

    But, if I have a bezier surface derived from a control net of only four points, the surface should touch all those four points, right?
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  2. #2
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    I solved the problem. Matlab indexing starts at 1, not 0 and I thought I had compensated for this, but I forgot one place.

    Attached is a bezier surface with this control net:
    (0,0,0) (1,0,0) (2,0,0)
    (0,1,0) (0,1,1) (0,1,2)
    (1,1,1) (2,1,1) (2,2,1)
    Attached Images Attached Images  
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    I'm glad you figured it out. Incidentally I am also learning to use Matlab.
    See you in 13

  4. #4
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    I've found myself able to produce code very fast using Matlab, but the readability of the code is often suffering a bit.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    Would you like to share some of it? Currently, I am only a few weeks into it, and I am doing it for engineering at my school. We are learning how to handle vectors and matrices, range variables, that type of stuff, so far.

    Are you doing this for your studies, or just because it's cool?
    See you in 13

  6. #6
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by Darkness
    Are you doing this for your studies, or just because it's cool?
    I'm taking a course in Geometry which involves lots of Beizer curves and a little Bezier surfaces. Actually drawing them instead of just doing the math helps understanding.
    I'm also taking a course in Matlab programming atm.
    Quote Originally Posted by Darkness
    Would you like to share some of it?
    Yes, but I've only jsut started doing Matlab programming, so there are probaby better/faster ways of doing many things.

    I've attached an .m file that draws a Bezier surface with a m*n control net given by a m*n*3 matrix.
    To draw a random surface, just do:
    Code:
    BezierSurf(rand(3,3,3));
    Attached Files Attached Files
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    Cool, that'll help me learn some things, thanks.
    See you in 13

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bezier Curves where y = f(x)
    By thetinman in forum Game Programming
    Replies: 11
    Last Post: 12-27-2008, 10:21 AM
  2. Collision detection between bezier and ball.
    By CornedBee in forum Game Programming
    Replies: 1
    Last Post: 04-27-2006, 01:49 PM
  3. Help with bezier functions
    By rich999 in forum C++ Programming
    Replies: 10
    Last Post: 03-18-2006, 01:57 PM
  4. Bezier curve
    By simo in forum Windows Programming
    Replies: 2
    Last Post: 12-11-2005, 03:01 AM
  5. Attaching Cylinder to Bezier curve...
    By MipZhaP in forum Game Programming
    Replies: 5
    Last Post: 09-02-2004, 11:09 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21