[Solved] Swivel

Discuss the presentation application
Post Reply
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

[Solved] Swivel

Post by sevalav »

Hello,

I want to rotate my object with Swivel option (Custom Animation/Add.../Entrance/(Exciting)Swivel.
Option Swivel do the job, but I need some a little modifications. I need that my object rotate only one half of full rotation. That means that what is on the left side on my object, in the end, it will be on the right side. Second, axis of rotation must be at 45 degrees.
Is it possible to do this in Impress?
Look my attached file.

Thanks in advance
Attachments
Swivel.odp
(12.51 KiB) Downloaded 355 times
Last edited by Hagar Delest on Tue Mar 01, 2016 11:02 pm, edited 1 time in total.
Reason: tagged [Solved].
Apache OpenOffice 4.1.0, Win
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Swivel

Post by Zizi64 »

You can create a custom animated picture by the selecting the image and then:
Insert - Animated Image - Option: Bitmap object - Button: Apply Object; and the do these steps ciclically:
1.: Left click on the object - position and size - TAB: Rotate - /rotate the object the by the desired step of the angle , for example: by 5°/ - OK
2.: Again on the animation panel: Apply Object
(You can adjust the duration, and the number of the replaying cycles too).

Repeat these steps.

And then: Button: Create
It will create an animated GIF picture.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Swivel

Post by Zizi64 »

How to add an animated object
How to add an animated object
Animated.odp
(116.61 KiB) Downloaded 375 times
Attachments
The created and embedded .GIF image
The created and embedded .GIF image
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

Re: Swivel

Post by sevalav »

Zizi64 thanks for your effort, but I need different kind of rotation, like twirl. Swivel option is that what I need. The problem with Swivel because I need further modification of that function. Just open my Impress document and press F5, you will see what kind of rotation I need.
Apache OpenOffice 4.1.0, Win
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Swivel

Post by Zizi64 »

Do you need something similar rotation located below in the attached file?

The animation procedure is same as the previous solution, but the phases are drawn with a macro code. The macro controls the height value of the object for every phase based on the scrollbar value, and the width of the object. The "rotation" means a transformation of the height of the object. The height values are calculated with function 'cosinus' (from the rotation angle: 0°...89° step: 5°). The angle of the axis of the object was switched between 0 and 45°: it was switched to 0 before modification of the height, and the angle was switched back to 45 ° after the modification of the height.
I get the scrollbar as parent of the event (muse button release), and I get the object (shape) for transformation by its name: "TheObject".
The modified phases of the image are added manually to the animation.
MySwivel2.odp
(86.63 KiB) Downloaded 350 times
The macro code for drawing the phases:

Code: Select all

REM  *****  BASIC  *****

 option explicit

Sub MySwivel(e)

 Dim oDrawDoc, oOriginalShape as object
 Dim oSize as object
 Dim oScrollBar as object
 Dim oScrollValue as integer

'	If (Not GlobalScope.BasicLibraries.isLibraryLoaded("XrayTool")) Then
'        GlobalScope.BasicLibraries.LoadLibrary("XrayTool")
'    End If
    
	oScrollBar = e.Source.Model
	oScrollValue = oScrollBar.ScrollValue
  
	oOriginalShape = GetNamedShapeOnCurrentPage("TheObject")
	oOriginalShape.RotateAngle = 0
	oSize = oOriginalShape.size
	oSize.Height = oSize.width*COS(oScrollValue/360*2*PI())
	oOriginalShape.size = oSize
	oOriginalShape.RotateAngle = 4500
End Sub 




Function GetNamedShapeOnCurrentPage(ShapeName as string) as object

 Dim oDrawDoc, oDrawPage as object
 Dim oShape as object
 Dim PageCount, j as integer

	oDrawDoc = Thiscomponent()

	If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then
        GlobalScope.BasicLibraries.LoadLibrary("Tools")
    End If
    
	oDrawPage = oDrawDoc.GetCurrentController.GetCurrentPage
	For j = 0 To oDrawPage.getCount()-1 
		oShape = oDrawPage.getByIndex(j)
			If oShape.GetName() = ShapeName then
				GetNamedShapeOnCurrentPage = oShape
			end if
	Next j
End function
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

Re: Swivel

Post by sevalav »

Thanks Zizi64! Looks imresiv. Questions: how to fix 2 things:
1. Is there way that this Animated Image do this flipping (or roation) only once, not an infinitive number of rotation?
2. If I have on slide something else, how to put this actions (Animated Image) in right time, after some others actions on that slide?
Apache OpenOffice 4.1.0, Win
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Swivel

Post by Zizi64 »

1. Is there way that this Animated Image do this flipping (or roation) only once,
Yes, there is. Just set the 'Loop count' parameter of the bitmap object to value 1 (instead of the 'max') at the beginning of the collecting procedure.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Swivel

Post by Zizi64 »

2. If I have on slide something else, how to put this actions (Animated Image) in right time, after some others actions on that slide?
A workaround method:
Copy the slide many times, and create a new slide for every new action. Use the Animated, and the Stable version of the objects on the different slides.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

Re: Swivel

Post by sevalav »

Thanks Zizi64. I finished animation. I discovered that I need different angle. I discovered that that is a problem, because macro rotate object on first orientation. So, after macro do his job, I need to manually rotate this picture and then I can put it in animation. In the end, I saw the problem. After animation, AOO shows first picture in animation! That is a big problem, because last picture must stay visible... Is there chance to fix this?
Apache OpenOffice 4.1.0, Win
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Swivel

Post by Zizi64 »

Please upload your example .odp file.
I discovered that I need different angle. I discovered that that is a problem, because macro rotate object on first orientation. So, after macro do his job, I need to manually rotate this picture and then I can put it in animation.
You can try modify the macro code, as you want. Please note: you can transform the picture height, and/or width by steps related of the result of an arithmetic function.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

Re: Swivel

Post by sevalav »

Your code:

Code: Select all

	oScrollBar = e.Source.Model
	oScrollValue = oScrollBar.ScrollValue
  
	oOriginalShape = GetNamedShapeOnCurrentPage("TheObject")
	oOriginalShape.RotateAngle = 0
	oSize = oOriginalShape.size
	oSize.Height = oSize.width*COS(oScrollValue/360*2*PI())
	oOriginalShape.size = oSize
	oOriginalShape.RotateAngle = 4500
I delete this line oOriginalShape.RotateAngle = 0 and can't see any differences... or?
Apache OpenOffice 4.1.0, Win
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Swivel

Post by Zizi64 »

Ooops! Then you need redraw the original image or transform it somehow, because my macro can modify the height of the original picture independetly from the actual rotation angle...

How you want to swilr it realy? Can you upload some manually created picture about the phases?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

Re: Swivel

Post by sevalav »

Here is my example. It is in right position, and axis of rotation. There is only one problem: when animation is finished first picture appears, and that I don't know how to avoid. I think that this is incorporated inside AOO. If somebody know how to change this (I need that last picture in animation remains visible) let us know.
Zizi64 I can't upload my example because it is too big (>128 KiB).
Apache OpenOffice 4.1.0, Win
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Swivel

Post by Zizi64 »

Zizi64 I can't upload my example because it is too big (>128 KiB).
Delete the unrelevant contents from a copy of ypour file, and upload the redoced size file,
or share a copy of the the original file on a free file sharing service (Google drive, or other)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

Re: Swivel

Post by sevalav »

Zizi64 wrote:
Zizi64 I can't upload my example because it is too big (>128 KiB).
Delete the unrelevant contents from a copy of ypour file, and upload the redoced size file,
or share a copy of the the original file on a free file sharing service (Google drive, or other)
There is only one problem: when animation is finished first picture appears, and that I don't know how to avoid.
Link: https://drive.google.com/file/d/0B4VGgg ... sp=sharing
Apache OpenOffice 4.1.0, Win
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Swivel

Post by Zizi64 »

A workaround method:
You can increase the duration time of the last phase to the maximum value.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

Re: Swivel

Post by sevalav »

Thanks Zizi64 :)
Apache OpenOffice 4.1.0, Win
Post Reply