On my slide I have a map of the South during the Civil War. I want to place a thick arrow pointing to Atlanta from the Northwest. I then want to create an animation where the arrow moves Southeast towards Savannah over the period of a few seconds, with the rear of the arrow remaining where it started, and the head of arrow proceeding Southeast as I described. The point is to illustrate Sherman's March to the Sea.
I seem to be able to move the arrow using a motion path, but I seemingly can't grow the arrow in any other way than horizontal or vertical (not diagonally). I also tried adding a rectangle object, and adding a wipe entrance effect, but wipe seems again to only allow its effect to happen from 90 degree angles.
Can anybody help me figure out what should be a seemingly easy task? I am using Powerpoint 2013.
One way to do this would be to use multiple arrows with different lengths and the animation feature. First make all the arrows invisible.
1. Make the 1st arrow appear with a left click trigger. This becomes the *current* arrow.
2. After the required delay, make the *current* arrow disappear while making the *next* arrow appear.
3. Repeat step #2 above until done.
Depending on your background, this might work. Put a box over the diagonal arrow the same color as the background, without boarders. Now animate the box with a motion path to the southeast, allowing your arrow to be revealed. If the box is an issue, combine the motion path with a wipe disappear from west to east, on a 0.25 to 0.5 second delay.
Related
I just recently began using Unity3D and this is my first game, so if I'm not doing things like I'm supposed to, please tell me.
There is a 2D character that I want to move one step forward using the Animation mechanism. This movement can be splitted in two parts :
Move forward the back leg, don't move the upper body ;
Use this leg to push and make the step, moving the upper body.
My problème is that I can't find a way to make this step permanent. As soon as it start looping on the "Idle" animation, then, it come back to the original position (before the step).
I don't know how to let my character stay in the position it was just between the "Step Forward" animation and the "Idle" animation.
I tried to add "Rigidbody 2D", "Box Collider 2D" and "Physics2D Material" on both feet and on the floor, but it somewhat breaks the IK script ("Simple CCD", from the youtube video "Unite 2014 - 2D Best Practices In Unity"). And I'm sure there is a much simpler way.
EDIT: My question was not clear enough. The idle animation is the default animation, where the character is doing nothing in particular. It's just moving a little while it's staying in position. When it runs "Step Forward", all the sprites are moved (only when the back leg is pushing). If all animations are stopped right now, then the character is indeed in a new position, closer to it's opponent. I can check that by removing the transition from "Step Forward" to "Idle". But from here, I want it to loop on the Idle animation. When the transition from "Step forward" to "Idle" is done, the character is NOT running Idle from it's new position, but from it's old position, before the step, as if it was pulled from backward. I want to run Idle from the new position.
Here is a longer gif when we can see more of the Idle animation :
And my Hierarchy panel looks like :
Main Camera
Karateka (the top GameObject container, with the Animator component)
Torso (the sprites)
Head
Right arm
Right leg
Right lower leg
Right foot
...
IK (the Inverse Kinematics targets)
Left fist target
Left foot target
...
Any suggestion is welcome.
If I get it right, you have the StepForward animation running and it gets cut in the middle back to idle. There, the StepForward animation triggers again but from the start and you wish to restart from where you left off:
You can record the normalized value of your StepForward animation and use it next time:
float normValue = this.animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
then you can use that value:
this.animator.Play("StepForward", 0, normValue);
Other possibility, you are not after that but simply you want to pause the animation without getting to Idle.
Use a parameter. You can add a float parameter (call it direction) in the Animator window (top left). Then select a state in the animator, it will open the animation setting in the inspector. Under speed, open the drop down where your new parameter should show up. And tick it.
Now, your direction float will affect the speed of your animation as such:
this.animator.SetFloat("direction", value);
if you give 0, you pause. Give back 1 to move forward. You can also lerp the value so it is not abrupt. Your way.
I have a sunburst code here: http://plnkr.co/edit/EG0MzWEPB242g7VdSQQd?p=preview
When I click the orange area that corresponds to "from tumor cell" (see the caption below in the diagram), I get focussed diagram centered on "from tumor cells".
When I mouseover the area in the region marked "Liver or Pancreas", the texts in the caption box below changes while it should not. I suppose this problem is only in the second and third quadrant (90 degree to 270 degree). I couldn't find a way to solve this problem after spending so much time.
I hope some one has an answer to it.
The problem is that you're attaching the mouse over handlers to the g element, which isn't updated when you click on a segment. The easy way to fix this is to attach the handlers to the path elements, which do get updated, instead. In that case you probably also want to set the text elements to receive no pointer events so that there are no spurious mouse events when moving over them.
Complete demo here.
I have a general question (I know I should present specific code with a problem, but in my case the problem is of a more general nature).
In Processing, let's say I make an ellipse:
ellipse(30, 30, 10, 10);
Now, is there a way to get the pixels where this ellipse is on the canvas? The reason would be to have a way of creating user interaction with the mouse (for instance). So when someone clicks the mouse over the ellipse, something happens.
I thought of turning everything into objects and use a constructor to somehow store the position of the shape, but this is easier said than done, particularly for more complex shapes. And that is what I am interested in. It's one thing to calculate the position of an ellipse, but what about more complex shapes? Are there any libraries?
Check out the geomerative library. It has a way to check whether the mouse is inside any SVG shape. I can't remember off the top of my head but it works something like you make a shape:
myShape = RG.loadShape("shape.svg");
and a point:
RPoint p = new RPoint(mouseX, mouseY);
and the boolean function contains() will tell you if the point is inside the shape:
myShape.contains(p);
It's better to use a mathematical formula than pixel-by-pixel checking of the mouse position (it's much faster, and involves less code).
For a perfect circle, you can calculate the Euclidean distance using Pythagoras' theorem. Assume your circle is centred at position (circleX,circleY), and has a radius (not diameter) of circleR. You can check if the mouse is over the circle like this:
if(sq(mouseX-circleX)+sq(mouseY-circleY) <= sq(circleR)) {
// mouse is over circle
} else {
// mouse is not over circle
}
This approach basically imagines a right-angled triangle, where the hypotenuse (the longest side) runs from the centre of the circle to the mouse position. It uses Pythagoras' theorem to calculate the length of that hypotenuse, and if it's less than the circle's radius then the mouse is inside the circle. (It includes a slight optimisation though -- it's comparing squares to avoid doing a square root, as that can be comparatively slow.)
An alternative to my original mathematical answer also occurred to me. If you can afford the memory and processing power of drawing all your UI elements twice then you can get good results by using a secondary buffer.
The principle involves having an off-screen graphics buffer (e.g. using PGraphics). It must be exactly the same size as the main display, and have anti-aliasing disabled. Draw all your interactive UI elements (buttons etc.) to this buffer. However, instead of drawing them the normal way, give each one a unique colour which it uses for fill and stroke (don't add any text or images... just solid colours). For example, one button might be entirely red, and another entirely green. Any other RGB value works, as long as each item has a unique colour. Make sure the background has a unique colour too.
The user never sees that buffer, so don't draw it to the screen (unless you're debugging or something). When you want to detect what item the mouse is over, just lookup the mouse position on that off-screen buffer. Get the pixel colour at that location, and match it to the UI element.
After you've done all that, just go ahead and draw everything to the main display as normal.
It's worth noting that you can cut-down the processing time of this approach a lot if your UI elements never (or rarely) move. You only need to redraw the secondary buffer when something appears/disappears, animates, or changes size/position.
By default Blender adds speed easing to the animation. I need to remove it to get consistent rotation speed on my model. How/Where can I modify ease curve?
Thanks
You are able to edit the key frame interpolation in the graph editor. Select your object and then choose the graph editor in the selection box at the bottom left of the screen. You can then zoom out using the scroll wheel to see the curve. You are able to edit the points by clicking them with the right mouse button and moving them with the left.
Picture a Windows Phone.
There is a ball (a circle).
When you tap somewhere the ball moves toward that tap.
When it reaches that spot, it stops.
You tap somewhere else.
The ball moves toward that second spot.
BUT, before it reaches its destination, you tap somewhere else. A third tap.
Now the ball changes directions toward the third tap.
To move toward a tap - this is a simple animation.
To change course mid-stream; how do you do that?
If I simply stop the first animation, there is no easing.
I need to change courses gently, smoothly.
An ideas?
If you want the easing to stop right where the ball is at point 2 and then the easing to start moving to point 3, I would do something like this:
Modify endpoint (second spot) to be 10-20 pixels from the balls current location in the direction of second spot.
When the spot reaches the new second spot, start moving toward spot three.
Here is a diagram to help: