Dark Bit Factory &  Gravity

Dark Bit Factory & Gravity

  • September 09, 2010 *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Pages: [1]   Go Down

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

0 Members and 1 Guest are viewing this topic.

energy

  • Atari ST
  • ***
  • Karma: 14
  • Offline Offline
  • Posts: 184
    • View Profile
    • WWW
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!
 
Logged
Purebasic 4.3, MASM

hellfire

  • Sponsor
  • Pentium
  • *******
  • Karma: 236
  • Offline Offline
  • Posts: 718
    • View Profile
    • WWW
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:

Logged

ninogenio

  • Sponsor
  • Pentium
  • *******
  • Karma: 88
  • Offline Offline
  • Posts: 1230
    • 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?
Logged

hellfire

  • Sponsor
  • Pentium
  • *******
  • Karma: 236
  • Offline Offline
  • Posts: 718
    • View Profile
    • WWW
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 »
Logged

ninogenio

  • Sponsor
  • Pentium
  • *******
  • Karma: 88
  • Offline Offline
  • Posts: 1230
    • View Profile
Re: OpenGL: saving Coordinates from glevalcoord1f
« Reply #4 on: March 14, 2008 »
very usefull info hellfire thanks very much k+!
Logged

energy

  • Atari ST
  • ***
  • Karma: 14
  • Offline Offline
  • Posts: 184
    • View Profile
    • WWW
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
Logged
Purebasic 4.3, MASM
Pages: [1]   Go Up
 

 

B l a c k R a i n V.2 by C r i p

Page created in 0.107 seconds with 18 queries.