IOS上的JQuery很慢,跳跃和生涩(JQuery on IOS is slow, jumpy and jerky)
我们的网站使用了大量的JQuery,但是对于iOS效果,例如淡入淡出,幻灯片等等,都是最好的。 它们并不流畅,例如在原生应用上的网络应用上看到的那些。
如何在这样的网络应用程序上实现这种平滑性。
有任何想法吗?
奇妙
例如。 看看这个页面。 它在iPAD上使用幻灯片和淡入淡出效果都是相当废话http://www.divethegap.com/update/diving-trips/master-scuba-diver#
Our site uses a great deal of JQuery, but on iOS effects such as fade, slide etc.. are jumpy at best. They are not smooth such as those seen on web apps on on native apps.
How does one achieve this smoothness seen on such web apps.
Any ideas?
Marvellous
EG. Have a look at this page. It uses slide and fade effects all fairly crap on the iPAD http://www.divethegap.com/update/diving-trips/master-scuba-diver#
原文:https://stackoverflow.com/questions/5524467
最满意答案
我正在使用3D坐标来考虑
- 由矢量翻译
[uv]
- 由matrixabcd进行二维线性变换
整体变换矩阵将具有这种形式
[ a b u] M = [ c d v] [ 0 0 1]
- 从三角形取3点
A=[x1 y1 1]
和B=[x2 y2 1]
,C=[x3 y3 1]
- 将它们与它们在变换
A' = [x1' y1' 1]
和B'=[x2' y2' 1]
并且C'=[x3' y3' 1]
。 Id est:用数学方法得到变换矩阵M
使A' = MA
和B' = MB
,C' = MC
- 将
x -> M x
应用于每个输入点编辑:看起来“做你的数学”并不清楚你。
你会意识到3个方程可以写成:
[x1' x2' x3'] [x1 x2 x3] [y1' y2' y3'] = M [y1 y2 y3] [1 1 1 ] [1 1 1 ]
要么
X' = M X
要么
M = X . X'^-1
是的,OpenCV在矩阵上有一个函数
inv()
。I'm using 3D coordinates to take account
- translation by vector
[u v]
- 2D linear transformation made by matrixabcd
The overall transformation matrix will have the form
[ a b u] M = [ c d v] [ 0 0 1]
- Take 3 points
A=[x1 y1 1]
andB=[x2 y2 1]
andC=[x3 y3 1]
from the triangle- Compare them with their position after transformation
A' = [x1' y1' 1]
andB'=[x2' y2' 1]
andC'=[x3' y3' 1]
. Id est: Do your math to get the transformation matrixM
so thatA' = M A
andB' = M B
andC' = M C
- Apply
x -> M x
to every input pointsEdit: Incorporate the translation in the matrix
M
using Translation in transformation matrixEdit: It seems "do your math" is not clear for you.
You'll realize that the 3 equations can be written as:
[x1' x2' x3'] [x1 x2 x3] [y1' y2' y3'] = M [y1 y2 y3] [1 1 1 ] [1 1 1 ]
or
X' = M X
Or
M = X . X'^-1
and yes, OpenCV has a function
inv()
on matrices.
相关问答
更多-
镶嵌点的平面(Tessellate a plane of points)[2024-01-20]
读第一行,称之为N 将剩下的点读入数组A 。 Point xdir = A[1] - A[0]; int xdim = 2; while (A[xdim] - A[xdim-1] == xdir) xdim++; int ydim = N / xdim; for (int y = 0; y < ydim-1; y++) { for (int x = 0; x < xdim-1; x++) { addTriangle(A[y*xdim+x],A[(y+1)*xdim+x],A[(y+1)*x ... -
用3d点创建飞机(create plane with 3d points)[2023-02-06]
我不明白这段代码到底在做什么,但似乎d (在线fixture = p1+offset + n*d; )必须是原点和由平面定义的平面之间的有符号距离。三点。 如果用方程Ax+By+Cz+D=0描述你的平面,其中(A,B,C)是代码中描述的正常单位向量n ,则d = - D 。 如果这是正确的,那么编写此代码的人特别讨厌从调用者那里询问d ,因为它可以从其他输入计算: d = dot(n,p1); 关于你的实际问题( The code will help me define if a 3D point is ... -
一架飞机的阴影(Shading of a plane)[2023-02-25]
与法线有关。 add geometry.computeVertexNormals(); 例如。 var vertices = geometry.attributes.position.array; for ( var i = -1; i < vertices.length; i += 3) { vertices[i] = Math.random() * 10; } geometry.computeVertexNormals(); To do with normals. add geometry.com ... -
到飞机的距离(Distance to a plane)[2022-11-06]
似乎你的Plane被实现,因此D不是你的一个点投影到平面法线上,而是负面投影。 您可以将此视为将平面中的矢量投影到法线上。 无论如何,我相信改变 float value = dot - plane.D; 至 float value = dot + plane.D; 应该解决的问题。 HTH。 It seems that your Plane is implemented so that D is not the projection of one of your points onto the plan ... -
取决于你想要的精度: 您可以通过Poisson磁盘采样获得随机正确的答案。 具体地,泊松盘采样是随机采样,使得没有点比指定半径更近。 这样的事情可以高效地(线性)实现,例如:来自Robert Bridson的c ++代码: http : //www.cs.ubc.ca/~rbridson/download/curlnoise.tar.gz实现他的论文http: //www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf 你可以真正优化点 ...
-
我发现最有效的方法是创建一个Anchor来处理感兴趣的x,z位置。 对于y坐标使用平面(或平面偏移)。 背后的理由是,随着对飞机的了解和飞机的扩大,计划的中心将会发生变化。 上下移动是很好的 - 因为你希望在你的案例中的飞机是地板。 但是因为你将原点固定在空间中,所以你可能不想左右和前后跳跃,所以使用锚点会比飞机的中心点更好。 What I have found works best is to create an Anchor to handle the x,z location of interest. ...
-
可以用几种方式定义平面。 通常使用平面上的点和法向量。 要从三个点( P1 , P2 , P3 )获得法向量,请取三角形边的叉积 P1 = {x1, y1, z1}; P2 = {x2, y2, z2}; P3 = {x3, y3, z3}; N = UNIT( CROSS( P2-P1, P3-P1 ) ); Plane P = { P1, N } 反之,从点P1和正常N到三点,你从任何方向G开始, 而不是沿着法线N这样DOT(G,N)!=0 。 然后沿着平面的两个正交方向 //try G={0,0, ...
-
变形点在一架飞机上(Deform points in a plane)[2024-01-31]
我正在使用3D坐标来考虑 由矢量翻译[uv] 由matrixabcd进行二维线性变换 整体变换矩阵将具有这种形式 [ a b u] M = [ c d v] [ 0 0 1] 从三角形取3点A=[x1 y1 1]和B=[x2 y2 1] , C=[x3 y3 1] 将它们与它们在变换A' = [x1' y1' 1]和B'=[x2' y2' 1]并且C'=[x3' y3' 1] 。 Id est:用数学方法得到变换矩阵M使A' = MA和B' = MB , C' = MC 将x -> M x ... -
我可能完全误解你的问题,在这种情况下,我表示歉意; 但我认为以下三种方法中的一种可能实际上就是你所需要的。 请注意,方法3给出的图像看起来很像您提供的示例...但我使用了非常不同的路径(根本不使用sphere命令,但通过工作来计算“体内”和“体外”)直接与他们离中心的距离)。 我将第二张图像与第三张图像进行了比较,因为它看起来更好 - 用零填充球体看上去就像一个黑色圆盘。 %% method 1: find the coordinates, and histogram them [x y z]=sphere ...
-
如果你的点都接近平面,你可以选择普通最小二乘(你可以看到Z是两个独立变量X和Y的函数,你最小化到平面的垂直距离的平方),或者总和最小正方形(所有变量独立,最小化正常距离之和)。 后者需要3x3 SVD。 (请参阅http://en.wikipedia.org/wiki/Total_least_squares ,遗憾的是这不是最简单的演示文稿。) 如果某些点是异常值,则需要采用稳健的拟合方法。 其中一个是RANSAC:选择三个点是随机的,建立他们的平面并计算所有点到平面的距离之和,作为适应度的度量。 在N个图 ...