![]() |
#1
|
|||
|
|||
![]()
I am putting together a PPT where I require an object to have motion paths. The object is to move round a circle. Is it possible to rotate the object along with a motion path? The motion path bit is quite easy - it's the rotation bit that would be quite useful. Thanks
|
#2
|
|||
|
|||
![]()
Hello,
The only way I know of how to get the rotation to be an animaiton is using a macro. Here is a bit of code that will rotate an object 360 degrees and the DoEvents line will make PowerPoint reposition the shape each time so it looks like an animation. Hopefully you are working with 2007. Public Sub CircleRotate() Dim sld As Slide Dim dude As Shape Dim n As Integer Set sld = ActivePresentation.Slides(1) 'slide number visual is on Set dude = sld.Shapes("Picture 2") 'name found by using Selection Pane n = 20 For i = 1 To n If i < 10 Then dude.Top = dude.Top + 1 dude.Left = dude.Left + 1 Else dude.Top = dude.Top - 1 dude.Left = dude.Left - 1 End If dude.Rotation = dude.Rotation + (360 / n) DoEvents Next i End Sub This will move the dude object in a line, for a circle you have to use four quandrants, so some adjustments will be needed. Then to execute the code, you can assign an action to the shape you are trying to move. Once you have written the macro, click on the shape, go to the Insert tab and you should see "Action" under the Links menu. Click on that and the Action Settings menu box will come up. Click on the Run a Macro option button and choose the macro name from the drop down. Hope this helps!! Signed, Math Nerd |
#3
|
|||
|
|||
![]()
OK, so I figured out how to make it work in a circle instead of just a line. You have to specify the size of the circle that you want to rotate the object around. In my macro, I have the circle on the slide, so I just name it.
OK, here it is: Sub finalmove() Dim sld As Slide Dim wheel As Shape Dim aro As Shape Dim n As Integer Dim pi As Double, angl As Double pi = 3.14159265358979 Set sld = ActivePresentation.Slides(5) 'slide objects are on Set wheel = sld.Shapes("Group 8") 'the circle of rotation whcenx = wheel.Left + wheel.Width / 2 'the center of the circle whceny = wheel.Top + wheel.Height / 2 rad = wheel.Width / 2 'radius of the circle Set aro = sld.Shapes("Left Arrow 10") ' object being rotated/circulated n = 52 'number of moves/spokes angl = 2 * pi / n For i = 1 To n aro.Left = whcenx - (rad * Sin(angl * i)) - aro.Width / 2 aro.Top = whceny + (rad * Cos(angl * i)) - aro.Height / 2 aro.Rotation = aro.Rotation + (360 / n) DoEvents Next i End Sub Let me know if this works, hopefully it is not too late. Math Nerd Last edited by jsmath22; 12-22-2010 at 04:47 AM. |
#4
|
|||
|
|||
![]()
Hi
Sorry for not responding earlier - been off work becoming a daddy ![]() Will give the code a shot and let you know - thanks for the assistance |
#5
|
|||
|
|||
![]()
Congratulations! If it doesn't work, let me know and I can try to fix it. If it does, could you mark the post solved? I am trying to advance from the "Novice" and I think a factor may be how many issues you solve.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
resolution problems with growing and image along a motion path | inf327 | PowerPoint | 4 | 10-27-2010 05:06 AM |