smoothing

Optimizing transition/movement smoothness for a 2D flash game

怎甘沉沦 提交于 2019-11-28 11:47:42
Update 6 : Fenomenas suggested me to re-create everything as simple as possible. I had my doubts that this would make any difference as the algorithm remains the same, and performance did not seem to be the issue. Anyway, it was the only suggestion I got so here it is: 30 FPS: http://www.feedpostal.com/test/simple/30/SimpleMovement.html 40 FPS: http://www.feedpostal.com/test/simple/40/SimpleMovement.html 60 FPS: http://www.feedpostal.com/test/simple/60/SimpleMovement.html 100 FPS: http://www.feedpostal.com/test/simple/100/SimpleMovement.html The code: package { import flash.display.Sprite;

smooth peaks in gnuplot

假装没事ソ 提交于 2019-11-28 11:34:43
I have datapoints f(x_i) at points x_i (function f not known, only numerically) with f(0) = 0. The data show a peaklike structure at small x, to be followed by a slow shoulder-falloff at larger x that sets in half-way down from the maximum. I want to plot smoothed lines through these data points. If I use bezier then indeed f(0)=0 is ok, but the peak is significantly (by about 25%), lowered. If I use acsplines then the peak looks somewhat better, but f(0) = 0 is not maintained. How can I smooth that dataset without loosing vital info (f(0)=0) or the peak-height of the distribution? Smoothing

Smoothen heatmap in plotly

淺唱寂寞╮ 提交于 2019-11-28 09:09:45
问题 I wanted to create a heatmap of a probability density matrix using plotly. import numpy as np from plotly.offline import download_plotlyjs, init_notebook_mode, plot import plotly.graph_objs as go probability_matrix = np.loadtxt("/path/to/file") trace = go.Heatmap(z = probability_matrix) data=[trace] plot(data, filename='basic-heatmap') This gives me an image like this: I want to smoothen the color of the squares so that the transition between adjacent squares in the image are somewhat

Math: Ease In, ease Out a displacement using Hermite curve with time constraint

烂漫一生 提交于 2019-11-28 08:31:14
I'm trying to write a method that interpolates from 0 to x (position of an object in one dimension) over time using acceleration at the beginning and deceleration at the end (ease out / ease in) with the only constraints that the total time is provided , as well as the duration of the acceleration and deceleration . the motion should replicate the inertia effect and I'm considering a Hermite curve for the non-linear portions. double Interpolate( double timeToAccel, double timeCruising, double timeToDecel, double finalPosition, double currentTime) { //... } Can someone point me out to a portion

Smoothing a rounded stroke in Core Graphics

我是研究僧i 提交于 2019-11-28 04:52:53
问题 I am creating my own UITableViewCells with a gradient background. I have all the logic and drawing worked out, but one thing I want to fix is the "chunkiness" around the corners of my custom cell: alt text http://grab.by/27SM If you zoom in on the corners, you can see what I am talking about. Here is the code I a using to generate the cell: CGContextRef c = UIGraphicsGetCurrentContext(); CGColorSpaceRef myColorspace = CGColorSpaceCreateDeviceRGB(); CGGradientRef myGradient = nil; CGFloat

Drawing smooth lines with canvas

梦想的初衷 提交于 2019-11-27 21:42:33
So far none of the threads here on smooth lines are correct. how to draw smooth curve through N points using javascript HTML5 canvas? Smooth user drawn lines in canvas Both result in jagged lines. By smooth I mean using the x,y points as control points to make the line smooth. The line does NOT need to go through the points. It simply has to draw a smooth line given n points. Basically I'm recording each line segment, then when the user mouses up, it wil smooth the line. I've tried my own method using bezierCurveTo but that only smooths every other point, and then the connecting points are

Smoothing Data in Contour Plot with Matplotlib

烂漫一生 提交于 2019-11-27 12:36:54
问题 I am working on creating a contour plot using Matplotlib. I have all of the data in an array that is multidimensional. It is 12 long about 2000 wide. So it is basically a list of 12 lists that are 2000 in length. I have the contour plot working fine, but I need to smooth the data. I have read a lot of examples. Unfortunately, I don't have the math background to understand what is going on with them. So, how can I smooth this data? I have an example of what my graph looks like and what I want

Optimizing transition/movement smoothness for a 2D flash game

天涯浪子 提交于 2019-11-27 06:30:42
问题 Update 6 : Fenomenas suggested me to re-create everything as simple as possible. I had my doubts that this would make any difference as the algorithm remains the same, and performance did not seem to be the issue. Anyway, it was the only suggestion I got so here it is: 30 FPS: http://www.feedpostal.com/test/simple/30/SimpleMovement.html 40 FPS: http://www.feedpostal.com/test/simple/40/SimpleMovement.html 60 FPS: http://www.feedpostal.com/test/simple/60/SimpleMovement.html 100 FPS: http://www

Smoothing a hand-drawn curve

时光怂恿深爱的人放手 提交于 2019-11-27 06:11:42
I've got a program that allows users to draw curves. But these curves don't look nice - they look wobbly and hand-drawn. So I want an algorithm that will automatically smooth them. I know there are inherent ambiguities in the smoothing process, so it won't be perfect every time, but such algorithms do seem to exist in several drawing packages and they work quite well. Are there any code samples for something like this? C# would be perfect, but I can translate from other languages. You can reduce the number of points using the Ramer–Douglas–Peucker algorithm there is a C# implementation here .

Smoothing data from a sensor

旧时模样 提交于 2019-11-27 02:38:33
I have a 3D sensor which measures v(x,y,z) data. I'm only using the x and y data. Smoothing only x and y would be enough. If I use a log to show the data, it shows me something like this: (time) 0.1 ... (Data log) x = 1.1234566667 (time) 0.2 ... (Data log) x = 1.1245655666 (time) 0.3 ... (data log) x = 1.2344445555 Well the data is more exact actually, but I want to smooth between the 1.1234 value and the 1.2344 value, because for me it's the same, I can use integers to, showing only "x= 1" but I need the decimals too, then, I need to show a sort of "smoothed" value here. Anyone has any idea?