Results 1 to 8 of 8

Thread: Evaluators -> Knots

  1. #1
    Senior Member Regular Contributor
    Join Date
    May 2004
    Location
    Renkum
    Posts
    193

    Evaluators -> Knots

    Hello
    I'm thinking of using elevatuors(using the GLU NURBS) for enviorment mapping for my game.
    My first question is, are evaluators good for level mapping?
    And what exactly are knots and how do they work?
    And my last question:
    If I have an array of control points which looks like this:
    GLfloat ctrlpoints[4][4][3];
    So I have an (x,y,z) value for each u and v.
    Why does ustride = 12 and vstride 3 instead of 12?
    Because stride is ucount * pointcount(in example (x, y,z) is 3) right?
    I hope anyone could help me with this rather stupid questions.
    Thanx in advance,
    Hylke

  2. #2
    Guest

    Re: Evaluators -> Knots

    I'm thinking of using elevatuors(using the GLU NURBS) for enviorment mapping for my game.

    Hmmm... I wonder if thou shouldst.

    My first question is, are evaluators good for level mapping?
    They can be. I doubt you'll want to use Opengl for this, since in a level editor you need realtime interactivity, and realtime evaluation of a world full of surfaces is going to be very slow. You'll probably want to manually subdivide the world's surfaces, and dynamically subdivide the the selection the user is editing.

    And what exactly are knots and how do they work?
    www.google.com for NURBS

    Why does ustride = 12 and vstride 3 instead of 12?
    Read the spec on glMap2
    http://pyopengl.sourceforge.net/docu...glMap2.3G.html

  3. #3
    Senior Member Regular Contributor
    Join Date
    May 2004
    Location
    Renkum
    Posts
    193

    Re: Evaluators -> Knots

    Originally posted by <Hlz>:
    I'm thinking of using elevatuors(using the GLU NURBS) for enviorment mapping for my game.

    Hmmm... I wonder if thou shouldst.
    Sorry for my bad English, but what do you mean?

    They can be. I doubt you'll want to use Opengl for this, since in a level editor you need realtime interactivity, and realtime evaluation of a world full of surfaces is going to be very slow. You'll probably want to manually subdivide the world's surfaces, and dynamically subdivide the the selection the user is editing.
    So I'd better use something like lib3ds?

    I've read that, but now it looks to me more logicly yo have both 3.
    because if you have control points that looks like this:
    GLfloat ctrlpoints[a][B][c];
    the number of floating numbers between ctrlpoints[0][x] and ctrlpoints[1][x] and ctrlpoings[y][0] and ctrlpoings[y][1] would both be c(where x is an unsigned value < a and y is an unsigned value < b)

  4. #4
    Guest

    Re: Evaluators -> Knots

    Sorry for my bad English, but what do you mean?
    It was a feeble attept to give you an amusing hint. What I mean is I'm not so sure that's a good idea. But more importantly, I'm not really sure what you mean by using evaluators for environment mapping. Could you clear that up a bit?

    So I'd better use something like lib3ds?
    Use whatever you want, but I don't see what lib3ds has to do with your original question.

    I've read that, but now it looks to me more logicly yo have both 3.
    To move along the u direction, you need to skip 3 floats (x, y, z) to get to the next u.

    To move along in the v direction, you need to skip 12 floats (x y z)*4 to get to the next v.

    This stride stuff is cool because it allows you to pack other stuff into your control point structure and safely walk over it. Stride is how big your step is in a given direction. In this case, it's measured in floats.

    If you had a structure like this

    struct ControlPoint
    {
    float position[3];
    float color[4];
    };
    ControlPoint controlPoints[4][4];

    Then you could do this

    glMap2f(
    GL_MAP2_VERTEX_3, // Target
    0, // U1
    1, // U2
    7, // U stride = pos + color = 3 + 4
    4, // U order
    0, // V1
    1, // V2
    28, // V stride = (pos + color)*4 = 28
    4, // V order
    controlPoints[0][0].position // Data
    );

  5. #5
    Guest

    Re: Evaluators -> Knots

    Originally posted by <Hlz>:
    Sorry for my bad English, but what do you mean?
    It was a feeble attept to give you an amusing hint. What I mean is I'm not so sure that's a good idea. But more importantly, I'm not really sure what you mean by using evaluators for environment mapping. Could you clear that up a bit?
    If you could imagine a bit larger bezier surface, with a little more holes and hilles it would already look like a level of some computer game.
    I'm currently programming a computer game, and I would like to know wheter it would be smart to use a bezier surface as level.

    Use whatever you want, but I don't see what lib3ds has to do with your original question.
    It doesn't, but I meant, if bezier surfaces are not good for level creation(in example because it can be exetremely slow if you have a big level) would it be better to use a large 3ds model instead?

    I've read that, but now it looks to me more logicly yo have both 3.
    To move along the u direction, you need to skip 3 floats (x, y, z) to get to the next u.

    To move along in the v direction, you need to skip 12 floats (x y z)*4 to get to the next v.

    This stride stuff is cool because it allows you to pack other stuff into your control point structure and safely walk over it. Stride is how big your step is in a given direction. In this case, it's measured in floats.

    If you had a structure like this

    struct ControlPoint
    {
    float position[3];
    float color[4];
    };
    ControlPoint controlPoints[4][4];

    Then you could do this

    glMap2f(
    GL_MAP2_VERTEX_3, // Target
    0, // U1
    1, // U2
    7, // U stride = pos + color = 3 + 4
    4, // U order
    0, // V1
    1, // V2
    28, // V stride = (pos + color)*4 = 28
    4, // V order
    controlPoints[0][0].position // Data
    );
    [/QUOTE]
    Oh ok.
    Thanx

  6. #6
    Senior Member Regular Contributor
    Join Date
    May 2004
    Location
    Renkum
    Posts
    193

    Re: Evaluators -> Knots

    Sorry for kicking this topic, but I just want my answeres sooo bad :-p
    Hylke

  7. #7
    Guest

    Re: Evaluators -> Knots

    Answers?

    From what I can see, your questions are both ill-conditioned and underdetermined. And, perhaps most importantly, they have nothing to do with opengl

  8. #8
    Senior Member Regular Contributor
    Join Date
    May 2004
    Location
    Renkum
    Posts
    193

    Re: Evaluators -> Knots

    imho it is related to OpenGL, but I could be wrong .
    But what's best choise:
    - a .3ds level
    - a big bezier surface
    - create an own level type of file(which is alotta work).

Similar Threads

  1. gluNurbsSurface() what is knots array?
    By 9ine in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-17-2004, 03:19 AM
  2. thorus knots & metaballs
    By zukko in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-10-2004, 10:55 AM
  3. nurbs-knots
    By 3DMind in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 02-12-2002, 03:14 PM
  4. B-splines, NURBS and knots
    By jankri in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 06-27-2001, 07:51 AM
  5. knots in NURBS
    By Boresight in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-21-2001, 10:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean