I am attempting something conceptually straight forward, but practically difficult to figure out. I want to make a video clip "blink" or "flicker" in after effects. I have two video clips layered on top of each other in after effects, and I want to make the top video, including it's audio, flicker on and off so that when the video is "off" the video playing beneath is visible.
Anyone familiar with after effects who can advise me on how to do this? Thanks.
I would suggest something like that inside opacity property:
speed = 5;
(value * Math.floor(Math.cos(time * Math.PI * speed) ) )
Related
I have applied some post processing effects to my camera. They looked fine in the free aspect minimized game view but when I maximize it or change the aspect ratio the effects look different. And also how can I make my UI elements change as the screen size changes.
Images:
This is a bug in post processing stack and is still not fixed by them. But I found a fix here.
Fix:
open the DepthOfFieldComponent.cs, remove const from before k_FilmHeight, then have it update somewhere such as in Prepare, above CalculateFocalLength, add something like: k_FilmHeight = 0.024f * (Screen.height / 720.0f);
720 can be changed to whatever number you want to use as your default screen height.
I am currently trying to find a way to have images bouncing around the page while rotating. So far, I have succeeded in the bouncing part: The code in action. However, I am still struggling with the rotating part: The source code. I believe the problem has something to do with rotating the image data. I have have heavily researched rotating canvas data, yet the however the bug still eludes me. Could anyone shed light on this mystery.
By the way, I know that the lag could be greatly improved by preloading each image before the image is inserted onto the canvas, but I don't want to over-complicate the code until I can get the basic lay-man version to work. So now that I have examined this, please don't post about it because it's not exactly on topic.
My 2nd smaller question is this: I have observed that, in Google Chrome, when I modify the frame rate to anything other than 60 fps, then there is a MASSIVE decrease in performance: 59 fps or 60-Math.pow(2,-16) fps appears a lot slower than 60 fps. I know that it can't be because on my monitors display rate because my monitor's display rate is 59 fps, not 60 fps. So, is it because Google Chrome recognizes and optimizes 1000/60, or what? Please include a link to the documentation if possible.
EDIT
The links have been moved to the final product displayed here.
There is no native way to rotate a Uint8ClampedArray
To rotate an image once it has loaded.
// ctx is the 2D context. Image is drawn at its center point.
function drawRotated(image,x,y,scale,rot){
ctx.setTransform(scale,0,0,scale,x,y); // set scale and origin
ctx.rotate(rot);
ctx.drawImage(image, -image.width /2, -image.height / 2);
ctx.setTransform(1,0,0,1,0,0); // restore default transformation
}
I am not at all sure what you are saying about the frame rate. A monitor with a frame rate of 59 is very unusual. As you have not shown what you are doing I will assume you are not using requestAnimationFrame
The following will sync to the browser refresh rate.
function mainLoop(){
// code to render the frame
requestAnimationFrame(mainLoop);
}
requestAnimationFrame(mainLoop);
I have a window displaying a video stream with a twitter feed as an overlay.
When a new tweet is displayed, the current tweet animates out using a rotate animation and the next tweet is rotated into view. The animations are performed using a RotateTransition.
The app also switches between different cameras to display different streams. To give an indication of when the app switches to the next camera, I have a progressbar that fills using a Timeline object.
This works well, until I resize the window. The rotate animations start to flicker, along with the progressbars as they gradually fill.
As a test, I disabled the video stream, to see what's happening. The 'artifact' doesn't occur then and I can resize as much as I want. If I play the stream and don't resize, everything works well.
The video player is based on VLCJ, but the actual pixels are drawn on a WritableImage in an Imageview.
See the following images that illustrate the problem.
At the bottom right you can see 2 different progress bars (a ProgresBar and a ProgressIndicator).
A part of the flickering result is still visible below the second image. It somehow stays visible, probably because the area doesn't get redrawn.
Any idea what makes the flickering happen? Is there anything I can do to fix or avoid this?
I tried some VM options in IntelliJ: -Dsun.java2d.d3d=true -Dprism.forceGPU=true to somehow enable hardware acceleration, but that doesn't seem to help.
Disabling the progressbar fill animation doesn't help either.
I had a similar problem with some arcs and shapes that would flicker when its attributes / sizes were changed.
The solution to my problem was to make sure that the methods used to change the shapes were called from inside the JavaFX thread.
Platform.runLater(() -> {
arc.setStartAngle(30);
arc.setLength(45);
}
How would I go about playing an animation backwards?
I've tried giving the animation handler negative delta but that just stops it. Subtracting the delta from this.currentTime of the animation doesn't work either.
Any ideas?
Since Three.js r69 it's possible to play animations in reverse order by setting animation.timeScale = -1 though only when animation.loop = true.
See Reverse animation, feature request #5062 for more updates.
I am using r126
Set action.loop = THREE.LoopPingPong will play the clip with the choosen number of action.repetitions, alternately playing forward and backward. (doc)
Coming from the iOS world where we have UIImageView and the property animationImages:
http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImageView_Class/Reference/Reference.html#//apple_ref/occ/instp/UIImageView/animationImages
Where animationImages is just an array of arbitrary animation frames. You specify the images (maybe 15), then set the total animation time (maybe 4 seconds) in one of the other properties, then just start the anim and the images in animationImages will play sequentially over the specified time with an even frame rate.
How would I do the same with WP7/Silverlight? This all Expression Blend seems wonderful, but I just can't find a way to animate the image source (I'm guessing it might be impossible). How would I do the same? Should I add a unique image object for each frame in the animation, then play around with visibility/opacity properties and manually have to create all the spaced out key frames? That sounds like a lot of extra work + overhead and not a nice way to go...
http://www.windowsphonegeek.com/articles/WP7-Animations-in-depthndash-Overview-and-Getting-Started
http://www.wearerighteous.com/wp7-development/xaml-animation-in-silverlight-for-windows-phone-7/
http://www.windowspresentationfoundation.com/?p=712
Try out these links. Especially the first one, I think the first one resolve all you doubts. In wp7 we can go for two options either XAML based (static) animations / or with the help of C# code. By using blend u can create all sot of static animation with out any issue. Here the animation is working on the basis of page frames. If u are interested in learning more about Animation try this too;
http://msdn.microsoft.com/en-us/library/cc189019(v=vs.95).aspx
You can actually animate the Image.Source property here's a tutorial.
Animating Images in WP7