mojave_ranger
mojave_ranger

Reputation: 69

Is there a way to move objects without using glTranslatef in OpenGL?

I'm new to OpenGL and I was wondering if there is a method that could help me simulate certain animations -such as jumping or flying- without using the glTranslatef. Any ideas about the matter ?

Upvotes: 1

Views: 918

Answers (2)

andand
andand

Reputation: 17507

You can use a vector / matrix library such as Eigen or GLM to manage your geometry. Both have a collection of affine transformation routines which will allow you to do what you're looking for. Once the transformations are applied to your geometry, they can then be rendered very easily with routines supplied in the libraries. I prefer Eigen, since the documentation is a bit more complete, but they both work well.

Upvotes: 3

genpfault
genpfault

Reputation: 52165

Translate your geometry before submitting it to OpenGL.

Upvotes: 3

Related Questions