Sprite rotation

sorenknud's picture

Hi there,

I wonder,

is there any way to make the y-axis "follow" the x-axis when rotating a sprite?

So that the origin follows the object itself? Right now the origin of the x-axis stays the same when i rotate the y axis, but i would the origin to change when i rotate the object.

Do you understand what i mean?

best, soren

liik's picture
Re: Sprite rotation

If i understood correctly what you want to do, the simple solution would be to place the sprite inside a 3D transformation macro and have all the XYZ Origin control you need...

sorenknud's picture
Re: Sprite rotation

Sure, i know, thanks, but i have multiple objects inside the 3d transformation....

cwright's picture
Re: Sprite rotation

place the sprite inside an additional 3d transform (inside the other 3d transform with the other objects)

sorenknud's picture
Re: Sprite rotation

But, i don't want to chance the origin, (position), i want to chance the "rotation-orign" (does that make sense?)

Example:

i rotate an image 45 dgr. on the Z axis, then i rotate it 45 dgr. on the Y axis, then the Y roatation does not "know" that the Z is rotated - it just rotates like if the image was not roatated at Z. But the Y axis should rotate "with" the Z axis....

best, soren

cybero's picture
Re: Sprite rotation

sorenkund, why not just feed y and z simultaneously ?

You could always publish up the input ports to root and then arrange the synchronous and congruent rotations at the root level of the composition.

liik's picture
Re: Sprite rotation

...yes do it in the root level, in order to rotate the way you want to you need to rotate the axis in the last 3d Transform (thats closest to root level) and the final rotation would be of the sprite itself...basically go backwards...

PreviewAttachmentSize
rotXYZ.qtz10.57 KB

sorenknud's picture
Re: Sprite rotation

Thank you!

In your example, the X-axis does not follow the Y-axis, it seems that with 3D transform in multiple "layers" you can not get all 3 axis to follow each other....

What i need to do, is interactive so i cannot tweak my way around it really..

best, soren

jersmi's picture
Re: Sprite rotation

I was just dealing with a similar issue -- the right combination of 3D Transformation patches was the solution for me. Here's an example. Note: the library macros will not load in QC3 (gradient and a mouse macro -- nothing serious, the comp will run). Also, click on the viewer to "attract" the butterfly.

PreviewAttachmentSize
butterfly.qtz550.68 KB