[compiz] [PATCH] cube unfold distance
David Reveman
davidr at novell.com
Mon Dec 18 09:54:39 PST 2006
On Fri, 2006-12-15 at 15:04 -0500, moppsy wrote:
> I have gone ahead and implemented the unfold distance option
> as mentioned in the source.
>
> the patch is here
> http://home.comcast.net/~moppsy/compiz/cube-unfold-distance.patch
If I remember correctly I think I left it hard coded to 1.5 because
there were some rendering issues when adjusting it too much. I think the
cubePaintTransformedScreen function doesn't deal with it properly.
Have you done some testing? Different distances with different number of
cube sides and so on? Any rendering issues must be fixed before I accept
this patch.
+#define CUBE_UNFOLD_DISTANCE_DEFAULT 1.5f
+#define CUBE_UNFOLD_DISTANCE_MIN 0.0f
+#define CUBE_UNFOLD_DISTANCE_MAX 10.0f
+#define CUBE_UNFOLD_DISTANCE_PRECISION 0.1f
+
0.0 as minimum doesn't make sense to me. Shouldn't that be 0.1 instead?
@@ -151,7 +157,7 @@ typedef struct _CubeScreen {
float timestep;
Bool unfolded;
- GLfloat unfold, unfoldVelocity;
+ GLfloat unfold, unfoldVelocity, unfoldDistance;
GLfloat *vertices;
int nvertices
No need to add unfoldDistance field to CubeScreen struct. Just have it
use cs->opt[CUBE_SCREEN_OPTION_UNFOLD_DISTANCE].value.f directly in
cubePaintTransformedScreen instead.
When we've made sure that no rendering issues exists and this patch
lands in head, it be nice to add support for increasing the distance
while having the cube unfolded. One action for increasing the distance
and one action for reducing the distance. This "UNFOLD_DISTANCE" option
would then work as "UNFOLD_DISTANCE_STEP".
-David
More information about the compiz
mailing list