Skip to content
Advertisement

Showing a dynamic plane

I have written a Python program that continuously returns 4 changing Cartesian coordinates that align to form a square plane that can be at any given orientation; yaw, pitch, or roll. What is the best way to go about displaying the constantly updating plane in 3D space?

Note: This is being done on a Linux machine if that changes anything, however I cannot see how it would.

Advertisement

Answer

You can use PyOpenGL for that.

http://pyopengl.sourceforge.net/

It can be installed with pip.

Easiest is to use the “legacy” API and draw a quad.

To change yaw, pitch and roll, use a transformation matrix and glRotate.

You can also use shaders with it and draw up the transformation matrix yourself.

https://en.wikipedia.org/wiki/Rotation_matrix

Example of drawing a textured plane with the OpenGL legacy API:

JavaScript
Advertisement