Re: coordinate system axes

Ian Mallett <[email protected]> Tue, 9 Jul 2013 21:41:39 -0700
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAG4NV=s7eHVEYhXhzfLkCkSND=bY8DiA0sGhVpX6D4DuE5ewig@mail.gmail.com>
On Mon, Jul 1, 2013 at 6:39 AM, Jano Ferencik <[email protected]>wrote:

> Hello there,
>
> i am fairly new to pyopengl and I am facing some difficulties.
> I am trying to create a indicator for the global coordinate system in the
> corner of a glcanvas wndow. I managed to create the lines but I am not able
> to rotate them when the object rotates
> I suspect I am not isolating the transform matrices correctly.
>
> Currently I can see the cube and the coordinate system indicator but the
> latter is fixed when I rotate the cube. I would lie the indicator to rotate
> so it will be clear in which direction the object was rotated
>
> The code comes from a bunch of examples i found online a
>
You should probably find some better examples. I only skimmed the code, but
already I could see there's some very dodgy stuff there--initializing glut
every time you draw, the resize and view methods (ultimately from NeHe),
and just general stylistic things that tell me the author didn't really *get
* it (e.g. ".createCube(self)" does no such thing). The GUI part is
probably more okay, but honestly if you want my advice, redo the OpenGL
part entirely.

Amazingly, there's not a lot of great code demonstrating how to do this on
the web, but, at the risk of self-promotion, I do have an Introductory
OpenGL Tutorial<http://www.geometrian.com/programming/tutorials/introgl/index.php>that
would probably be very helpful for getting started with OpenGL 2 style
programs. It's written for C++/C99, but it's quite readable to Python
users. Once you understand the theory behind this stuff, you might
like my PyOpenGL
Base Code<http://www.geometrian.com/programming/tutorials/OpenGL%20Program%20Shell.py.txt>,
which is a well-tested, proven Python template for starting PyOpenGL code.
It requires PyGame, which works very nicely with PyOpenGL. Theoretically,
you could alter it to use GLUT, but you shouldn't be using that anyway.

Lastly, my suggestions for future help might point you to the forums at
GameDev.net, which has a special OpenGL board, lots of OpenGL-related
resources, and a generally faster turnaround time.

HTH,
Ian

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users