Where is the box?  Is it just at the origin of its parent world?

> After a brief chat with a few on the IRC, I thought I'd further specify
> what I'm trying to do:
>
> Let this be the top view of a box (which one day may be the base of a
> miniature counter).
> 1----2
>
> 3----4
>
> I want to pivot this box around the Y axis but centered using either
> vertex 1 or 2 such that after a 90 degree rotation (chosen because its
> easier in ASCII):
>
>   3--1
>
>   4--2
>
> Note that 2 is at the same position as before the rotation. So, if 2's
> coordinates was originally (0.5, 0, 0), the line defined by the points:
>
> a = soya.Point(self.parent,0.5,0.0,0.0)
> b = soya.Point(self.parent,0.5,1.0,0.0)
>
> should intersect both 2 and the vertex under. However, the line
>
> self.rotate(proportion * 5.0, a, b)
>
>
> doesn't rotate the box but instead make it spiral out of view.

It sounds really like your co-ordinates are somehow confused, as you noted 
elsewhere it seems like the origin of the rotation is far away.  If your cube 
wasn't at 0,0,0 in the parent world, that would cause this kind of problem 
for instance.

More general code, which might also fix this bug, could specify the axis of 
rotation in terms of your cube's co-ordinate system - then it would work 
anywhere.

So you'd do soya.Point(self, <co-ordinates relative to cubes centre>) to 
define the points on the axis of rotation.  Then wherever you move the cube 
in the parent world, you can always use this axis to rotate around that edge 
of the cube.

> Interestingly, for:
>
> a = soya.Point(self.parent,0.0,0.0,0.0)
> b = soya.Point(self.parent,0.0,1.0,0.0)
>
> works as expected (same as rotate_y). while the almost identical

OK, that does seem strange given the other results.

Cheers,
Mark

> a = soya.Point(self.parent, 0.001, 0.0, 0.0)
> b = soya.Point(self.parent, 0.0,   1.0, 0.0)
>
> Propels the box toward in the -Z direction exptremely fast (which
> suggest a very, very far away axis of rotation.) I figured that out by
> multiplying proportion by 0.001 instead of 5.0.
>
> I'm assuming that I'm missing something, but this behaviour is confusing
> to me.
>
> Christian
>
>
>
>
> _______________________________________________
> Soya-user mailing list
> Soya-user@gna.org
> https://mail.gna.org/listinfo/soya-user



-- 
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)

_______________________________________________
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user

Reply via email to