Author Topic: OpenGL: saving Coordinates from glevalcoord1f  (Read 7120 times)

0 Members and 1 Guest are viewing this topic.

Offline energy

  • Amiga 1200
  • ****
  • Posts: 280
  • Karma: 25
    • View Profile
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

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: OpenGL: saving Coordinates from glevalcoord1f
« Reply #1 on: March 14, 2008 »
Is it an option to simply implement it yourself?
What it basically does is this:

Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: OpenGL: saving Coordinates from glevalcoord1f
« Reply #2 on: March 14, 2008 »
 ;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:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: OpenGL: saving Coordinates from glevalcoord1f
« Reply #3 on: March 14, 2008 »
Quote
ive 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.

Quote
what does that equation mean?
That "Sum"-Sign is nothing more than a loop:
Code: [Select]
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.

Quote
i 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).
« Last Edit: March 15, 2008 by hellfire »
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: OpenGL: saving Coordinates from glevalcoord1f
« Reply #4 on: March 14, 2008 »
very usefull info hellfire thanks very much k+!
Challenge Trophies Won:

Offline energy

  • Amiga 1200
  • ****
  • Posts: 280
  • Karma: 25
    • View Profile
Re: OpenGL: saving Coordinates from glevalcoord1f
« Reply #5 on: March 15, 2008 »
@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