3D Animated Widgets
pkpovray generates 3d widgets pixmaps using povray. It defines a process of writing scenes in python and storing the images as a qt resource, ready for use as a pre-packaged widget. (milestone:pkpovray-0.2)
button = SuperEllipsoid(.3, .15,
pigment=Pigment(color=WHITE),
finish=Finish(phong=.3),
scale=(X_SCALE, .3, .45),
translate=(0, -.1, 0),
)
Components
- pk/povray/sdl.py: Write povray scenes in python.
- bin/pkpovray: Manage widget packages.
Basic Concepts
- Widgets are animated using pixmaps generated from povray.
- Povray scenes are written in python using pk/povray/sdl.py
- Widget attributes (size, etc) are set in a simple xml project file.
- Each frame is rendered using the easily batched bin/pkpovray.
- Widget pixmaps are cropped to the widget size using a simple xml project file.
- Qt4's resource system is used to load the pixmap data, and superclasses are provided in pk/widgets/pixmapwidgets.py
Quickstart
- Write scenes in povray.
- Add clock functions to animate your scene.
- Render the widget's pixmaps using the scene.
- Crop the pixmaps with pkpovray.
- Use pkrcc to generate a qt resource file.
- Use pyrcc4 to embed the pixmaps into a python module.
- Subclass a widget class from pk.widgets.pixmapwidgets.
Examples
- resources/povray/widgets: My widgets
- resources/povray/widgets/render: batch render script.
- bin/pkdemo: The script for the screenshot above.