• Welcome to Dark Bit Factory & Gravity.
 

OpenGL: saving Coordinates from glevalcoord1f

Started by energy, March 14, 2008

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

energy

Hi
I generated with glevalcoord1f a Bezier-Curve!
Is it possible to save the generated Coordinates in an external array?
Is there a function that does it?
Havent found anything in the RedBook!

Want to use them for camera!!!

Thanx in advance!
coding: jwasm,masm
hobby: www.scd2003.de

hellfire

Is it an option to simply implement it yourself?
What it basically does is this:

Challenge Trophies Won:

ninogenio

 ;D and for people like me, what does that equation mean?

@energy i dont think its posible with ogl to retrieve transformed coords. you have to manually transform any coords you wish to keep track of. having said that ive never used glevalcoord1f what exactly does it do?
Challenge Trophies Won:

hellfire

#3
Quoteive never used glevalcoord1f what exactly does it do?
The Function glEvalCoord1f evaluates a polynomial previously specified by glMap1f and sets its' value as vertex-, texture-, normal- or color-value.
Polynomials are just smooth functions with some ups & downs.

Quotewhat does that equation mean?
That "Sum"-Sign is nothing more than a loop:
for (int i=0;i<n;i++)
  y+= a[i] * pow(x, i);

where "a" are the polynomial's coefficients from glMap1f() and "x" the parameter you passed to EvalCoord1f().
In practice you won't use the "pow" but just do another multiply.

Quotei dont think its posible with ogl to retrieve transformed coords
I think you won't get a vertex-position since it's not an actual state (maybe i'm wrong here) but you can tell EvalCoord to generate a texture coordinate and read that back using glGetf(GL_CURRENT_TEXTURE_COORDS, &values).
Challenge Trophies Won:

ninogenio

very usefull info hellfire thanks very much k+!
Challenge Trophies Won:

energy

@Hellfire thanx for the answer.
Thought that OPENGL can do the work for me!
so i did i handy...
a cool Tut about this is:
http://www.gamedev.net/reference/articles/article1808.asp

cheers
energy
coding: jwasm,masm
hobby: www.scd2003.de