Math notation mapping in Python / OpenGL?

How can I display math notations / expressions in Python with OpenGL?

I use pyglet , however it uses OpenGL.

Things like this :

Quadratic formula

I cannot store static images since I also generate expressions.

+4
source share
3 answers

I would say by creating a suitable latex expression, turning it into an image, and then load the image as a texture.

+9
source

You can use the GL_TEXTURE_RECTANGLE_ARB extension to quickly load a dynamically generated image of arbitrary size into an OpenGL texture. You can find examples of using python to use dynamic vector graphics with opengl at http://cairographics.org/OpenGL/ , although if you want to display complex formulas, you also need to look at a suitable system such as latex.

+3
source

I don't know about OpenGL bits. But matplotlib has a matplotlib.mathtext module for rendering a subset of TeX math expressions.

+1
source

Source: https://habr.com/ru/post/1303098/


All Articles