Any use?bluenic wrote:Hi,
I'm searching for a method, to rotate graphics by a deliberate angle, or, at least, printing text to the screen at an angle of my choice. Preferably in Python, but C won't hurt too much, if there's no other option.
To give an example of what I intend to do, have a look at this stunning project http://www.youtube.com/watch?v=EFukhFujWuY
Unfortunately, the author seems to be unreachable. On his project page http://amrhein.eu/Radio2 he claims having used SDL for the UI, but I can't find any method to do a smooth rotation.
I would greatly appreciate any help on this.
Many thanks in advance, Klaus
Yes, I already thought this issue certainly would come up.toxibunny wrote:what would you do if there wasn't enough space on a circle to fit all the channels?
It's not a real dial bluenic is making, so all that matters is that the stations appear in the right order when the knob is turned either way.toxibunny wrote:what would you do if there wasn't enough space on a circle to fit all the channels?
You could use OpenVG instead of OpenGL ES, as long as you just need 2D graphics. OpenVG both handle bitmap and vector fonts and various basic transformations like rotation, scaling, translation, shearing, etc...PeterO wrote:You could use the GPU via openGL ES to do all the hard stuff.
1) Render the bitmap font into a texture
2) Load texture into GPU.
3) Load a vertex shader that will transform the area of the texture containing a letter into a position along the curve for the tuning dial.
3)For each letter to be displayed use the shader to render it into the correct position.
4) Read back completed image from gpu into cpu and then output the pixels to a small LCD.
Code: Select all
import pi3d DISPLAY = pi3d.Display.create() CAMERA = pi3d.Camera(is_3d=False) myshader = pi3d.Shader('uv_flat') myfont = pi3d.Font('fonts/FreeMonoBoldOblique.ttf') mystring = pi3d.String(camera=CAMERA, font=myfont, is_3d=False, string='Rotating') mystring.set_shader(myshader) while DISPLAY.loop_running(): mystring.draw() mystring.rotateIncZ(1)