user562566
user562566

Reputation:

OpenGL rotating textured planes in 3D space

I'm wondering if anyone could point me to any resources that would deal in rotating one or several 2D textured planes in 3D space. Something like this but with openGL (preferably C++):

2D Planes in 3D space

I'm attempting to do pretty much the exact same thing but no matter how I order my operations I'm getting right-screwy results. So I figure asking for some resources on the subject is better than posting tons of code and asking for people to fix my problems for me. :)

Upvotes: 1

Views: 1285

Answers (3)

Nik
Nik

Reputation: 591

You should look into scene graphs. Basically it is a way to define a bunch of objects (2D textured planes) and their transforms in 3D space. This allows you to define transforms that work on multiple nodes (objects) as well as single nodes. You can make a pretty simple one in C++ with little effort, or use one such as OpenSG or OSG (slight learning curve needed).

Wikipedia - http://en.wikipedia.org/wiki/Scene_graph

Upvotes: 1

Stefan Werner
Stefan Werner

Reputation: 440

The NeHe tutorials are a very popular place to learn the basics of OpenGL. In particular, the tutorial about texture mapping should help you: http://nehe.gamedev.net/tutorial/texture_mapping/12038/

Mind you though that these tutorials are written for older OpenGL versions which are more beginner friendly IMHO.

Upvotes: 1

celem
celem

Reputation: 404

If you havent already, do a search for 'NeHe tutorials'. An excellent set of OpenGL tutorials.

Here is a link to the rotation tutorial, includes all the source code in downloadable format and the tutorial walks you through each relevant line.

http://nehe.gamedev.net/tutorial/rotation/14001/

I believe this is working in a 2D space, the step up to 3D probably involves a bit more matrix math but...doable

Upvotes: 1

Related Questions