问题标签 [plane]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
sequence - Mathematical technique to check intersection
Imagine there is a very very large room in the shape of a hollow cube. There are magic balls hanging in the air at fixed discrete positions of the room. No magic ball has another one exactly above it. If we take an imaginary horizontal plane of infinite area and pass through the cube, how can we be sure that the plane doesn't cut through any of the magic balls ?
The height of a magic ball is given as a function of its position (x and y). The distribution is such a way that some balls are at the same height while other are at different heights.
Let the function be
z = axy + bx + cy
where a,b,c are positive integer constants.
The positions (x-axis and y-axis values) and also the height (z) are discrete values (for simplicity, we can consider them positive integers).
If the ball distribution function was z=10xy+8x+4y, then it is impossible to have a z value of 15 or 21. So a plane at z=15 or z=21 would not cut any of the balls! In fact, in this case, any plane with a height (z = any odd number) would not cut through the balls. It is noticeable that there a some planes with height as even numbers that donot cut through the balls.
We do not want to find the heights of all the magic balls and compare it with the height of the horizontal plane, as that would be like trying all the possible combinations and would take very long time even on a computer.
Our aim is to find a fast method by which we can tell whether a given value of z (height) can be produced by any pair of (x,y) (positions).If a given z cannot be produced, then a plane at that height doesn't cut through any balls! The question is also similar to finding whether a given number is present in a sequence produced by a function of two variables.
It would a great help if U could give me any suggestions to solve this problem. Thank You. (I have already tried evolutionary computing like GA,PSO,DE,SA etc. The method needs to be deterministic).
javascript - Javascript 三项式问题
好的,使用 Javascript(或者我可以轻松转换的东西,我非常了解 BASIC,但对 C++ 和 C# 有点生疏)我需要解决这个问题/方程式:
给定直线的起点和终点(在 x、y 和 z 中),直线上的哪个点满足方程
A、B、C 和 D 已定义,但 xy 和 z 是未知数,但在我上面知道的那条线上。我需要从这里得到点的 x、y 和 z。
3d - 如何有效地旋转和平移 3D 平面
我有一个由法线(n)和距离(d)(从原点)定义的平面。我想把它变成一个新的系统。很长的路是这样的: 1) 将距离 (d) 与法线 (n) 相乘,得到 aa 向量 (p) 2) 旋转 (R) 并平移 (v) 向量 (p) 得到 (p') 3)归一化(p')以获得法线 4)使用另一种算法来找到新平面和原点之间的最小距离(d')
我还没有尝试过,但我想它应该可以工作。问题:没有更快的方法来获取 n' 和 d' 吗?如果翻译 (v) 为 0,我可以跳过 4)。但如果不是0呢?有没有更简单的方法来获得新的 d'?
opengl-es - Opengl ES - 绘制多个顶点的平面
使用适用于 Android 的 Opengl ES 在绘制带有纹理的正方形时遇到问题。从远处看,它们看起来很好,但是当靠近模型时,纹理会变坏。我们认为这是因为模型仅包含四个顶点:
浮动 [] 坐标 = {
-1, 1, 0.0f,
1, 1, 0.0f,
-1, -1, 0.0f,
1, -1, 0.0f,
};
这就是为什么我们要扩展模型,使它由 10x10 多边形组成,所以问题是:我们必须按什么顺序绘制顶点才能创建一个类似这样的平面:
http://cocktailgenerator.net/cis4/plan.png
使用 GL_TRIANGLE_STRIP 我们可以绘制一个多边形矩形,如 (1x10) 并且效果很好,但是我们如何将其扩展为 10x10?
3d - 3D线平面相交,与简单平面
我在 3D 空间中有两个点,它们的 X 坐标具有不同的符号。所以其中一个肯定位于 X 平面的一侧,另一个位于另一侧。
现在我想以最简单和优化的方式找到这个平面和两点组成的线的交点。
我知道如何进行一般线平面相交,但由于在这种情况下平面只是 x 平面,我认为应该有一些捷径可以走。
谢谢!
c# - Plane projection and scale causing bluring in silverlight
Ok,
So I've tried to make an application which relies on images being scaled by an individual factor. These images are then able to be turned over, but the use of an animation working on the ProjectionPlane rotation.
The problem comes around when an image is both scaled and rotated. For some reason it starts bluring, where a non scaled image doesn't blur.
Also, if you look at the example image below (top is scaled and rotated, bottom is rotated) the projection of the top one doesn't even seem right. Its too horizontal.
This this the code for the test app:
So if anyone could possible shed any light on why this may be happening, I'd very much appreciate it. Suggestions also welcome! :)
** Update **
Just to clarify, if the projection plane rotation is 0, the image becomes un-blurred, so its only during the rotation that the image is blurred.
3d - 使用 2*3 矩阵在平面上投影
通过使用矩阵,我可以轻松地将一组 3D 点投影到具有法线向量 (1,1,1) 的平面上
我想做同样的事情,但是要投影到具有法线向量(a,b,c)而不是(1,1,1)的任意平面上。如何找到矩阵?
提前致谢!
编辑:改写问题:
从 (1,1,1) 看时,三个单位向量投影到 (-sqrt(3)/2, -1/3), (sqrt(3)/2, -1/2), (0, 1)。(直到一个无关紧要的比例因子。)
当从(a,b,c)而不是(1,1,1)查看时,我想找到三个单位向量的投影。
c - 从数组数据中获取平面切片
大家好,
我将 3d 网格数据(来自多个 TIF 图像)读入如下结构:
现在我想从这个一维网格数据中获取平面切片:
例如:
但我很难沿着其他轴实现:
和
有什么简单的算法吗?提前致谢。
c# - 碰撞检测自定义草图形状,表示为点列表
我有一组由用户绘制的点。他们将围绕一些物体进行绘画。
我需要以某种方式将这组点变成一个形状,这样我才能找到检测碰撞的区域。
一张图片将阐明:
表示为形状的点集 http://www.imagechicken.com/uploads/1277188630025178800.jpg 。
到目前为止,我最好的想法是遍历每个像素来确定它是在形状“内部”还是“外部”,但这会非常慢,而且我什至不确定如何确定“内部”/ “外面”一点...
有什么提示吗?我正在使用 .NET(C# 和 XNA),如果这对您有帮助的话!
opengl - 没有 glutLookAt* 函数的点 - 平面碰撞
据我了解,建议使用 glTranslate / glRotate 来支持 glutLootAt。除了明显的硬件与软件计算模式之外,我不会寻找原因,而只是顺其自然。但是,这让我有些头疼,因为我不知道如何有效地阻止相机突破墙壁。我只对点平面交叉点感兴趣,而不是 AABB 或其他任何东西。
因此,使用 glTranslates 和 glRotates 意味着当世界围绕它旋转时,视点保持静止(为简单起见在 (0,0,0) 处)。这对我来说意味着为了检查任何交点,我现在需要为每个摄像机移动重新计算世界顶点坐标(glutLookAt 方法不需要)。由于无法从 GPU 领域获得所需的新坐标,因此需要在 CPU 领域手动计算它们。对于每一个摄像机移动...... :(
似乎需要将当前旋转保留在 3 个轴中的每一个旁边,并且对于平移也是如此。我的程序中没有使用缩放。我的问题:
1-上述推理有缺陷吗?如何 ?2 - 如果没有,必须有一种方法来避免这种重新计算。我看到它的方式(并通过查看http://www.glprogramming.com/red/appendixf.html) 它需要一个矩阵乘法进行平移,另一个矩阵乘法用于旋转(仅需要 y 轴除外)。然而,必须计算如此多的加法/乘法,尤其是正弦/余弦肯定会扼杀 FPS。将有数千甚至数万个顶点需要计算。每一帧......所有的数学......在计算了世界的新坐标之后,事情似乎很容易——只要看看是否有任何平面改变了它的“d”符号(来自平面方程 ax + by + cz + d = 0)。如果是这样,请使用轻量级叉积方法来测试该点是否在该平面的每个“移动”三角形内的空间内。
谢谢
编辑:我发现了 glGet 并且我认为这是要走的路,但我不知道如何正确使用它:
m_vt16CurrentMatrixVerts 是一个 float[16] 填充 0.f 或 8.67453e-13 或类似的东西。我在哪里搞砸了?