PDA

View Full Version : Evaluators -> Knots



Hylke Donker
07-17-2005, 10:50 PM
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

07-18-2005, 12:01 PM
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 (http://www.google.com) for NURBS :rolleyes:


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

Hylke Donker
07-18-2005, 11:10 PM
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?


Read the spec on glMap2 :rolleyes:
http://pyopengl.sourceforge.net/documentation/manual/glMap2.3G.html 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)

07-19-2005, 09:40 AM
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
);

07-19-2005, 10:55 AM
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

Hylke Donker
07-21-2005, 05:03 AM
Sorry for kicking this topic, but I just want my answeres sooo bad :-p
Hylke

07-21-2005, 07:38 AM
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 :p

Hylke Donker
07-22-2005, 12:17 AM
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).