- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我觉得这个问题可能已经在这里被问/回答了,如果是这样,我对带宽表示歉意,但我没有看到任何解释。
在 Flash AS3 中如何从一个对象的坐标空间转换到另一个对象的坐标空间?我可以在一个对象中取一个点,并使用 local3DToGlobal() 将其转换为全局坐标,然后使用 globalToLocal3D() 将其转换为另一个对象的本地坐标 - 但有直接的方法吗?
因此,如果我希望一个对象能够对另一个对象说:“将你的左上角移动到我的左上角”,即使这两个对象位于不同的 z 空间、进行 3 维旋转等。
我假设它是在matrix3D矩阵操作中 -
矩阵乘法?变换向量()? deltaTransformVector()?
我一直在研究 API,但非常希望有一个具体的例子。
谢谢!
最佳答案
一种方法是 getRelativeMatrix3D()
,从显示对象的 transform
属性调用,如:transform.getRelativeMatrix3d(root).position
。
Returns a Matrix3D object, which can transform the space of a specified display object in relation to the current display object's space. You can use the getRelativeMatrix3D() method to move one three-dimensional display object relative to another three-dimensional display object.
来自 Adobe 的 Performing complex 3D transformations ,有一个使用 Matrix3D 对象重新排序显示的示例,其中对盒子的面进行重新排序,以确保 3D 显示对象的分层对应于应用旋转后的相对深度:
var faces:Array;
for (var i:uint = 0; i < 6; i++)
{
faces[i].z = faces[i].child.transform.getRelativeMatrix3D(root).position.z;
this.removeChild(faces[i].child);
}
faces.sortOn("z", Array.NUMERIC | Array.DESCENDING);
for (i = 0; i < 6; i++)
{
this.addChild(faces[i].child);
}
关于actionscript-3 - ActionScript 3 : translating coordinates from object's 3D space to another's?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15979702/
在我的项目中,我使用 LocationSearchTable/MKLocalSearch。当用户点击一个项目时,我的添加注释方法在 MapViewController 中被调用: func dropP
我很想知道如何检查字符串是否具有两个坐标的格式,例如: (signed int x,signed int y) 我已经通过搜索找到了一些答案,但我还没有完全理解它们(刚开始使用 C++),我要求一个简
在我正在编写的程序中,我为两个类(坐标和图形)编写了代码,其中一个将另一个作为构造函数参数。当我尝试编译它时,出现以下 Graph.cpp 错误: undefined symbol : “Graph:
我在 OpenGL ES 中绘制变化的条,它有坐标 (x,y,z)。 我想在 Action_Down 上添加一些更改(例如:栏中的颜色)。有 getX(),但此方法返回以像素为单位的 x 坐标,而不是
因为我之前的问题很不清楚,所以我编辑了一下: 我有以下问题: 我想为半径为 r+fcr_size 的空心球体构建一个图案。空心球体的空腔半径应为 r。有了这个图案,我可以在许多不同的球体中心使用它,并
我想使用 Vuforia 检测标记并在其上放置一个 3d 对象。从那时起,我想在我的应用程序中使用 ARKit。我如何知道检测到的标记或 3d 对象的 ARKit 世界变换? 我正在使用相同的 Vie
我有一组纬度/经度坐标,我可以使用它们进行投影,例如 Mollweide 投影。 library(mapproj) set.seed(0) n 180] = my.points$x[my.point
我正在使用 JavaScript 进行视频处理,我做得很好,但我使用的是一种名为 canvasCtx.rect () 的方法,它接收这些参数。 然后我可以从使用 getImageData () 方法绘
我创建了一个新项目作为单 View 应用程序。在 View Controller 中添加了用于将 View 坐标转换为窗口坐标的代码: - (void) dumpFrame { CGRect
简短版本:如何将 SVG 路径添加到 Leaflet map ,以便在 map 坐标更改时(例如缩放更改或滑动时)路径会更新? 长版:你好,我有一个地形image包含建筑轮廓。对图像进行地理校正后,我
我编写了一个代码,使用 astropy 将坐标从地球固定系统转换为惯性坐标系: from astropy import coordinates as coord from astropy import
我的多显示器设置中遇到以下情况: 在此示例中,我希望将窗口精确定位在黄色箭头所示的坐标处。然而,我所拥有的只是 NSView 的坐标,它是跨越整个(更大、更上面)辅助监视器的 NSWindow 的 c
我不知道如何将 Pane 上圆形对象的所有 x 和 y 与鼠标的 x 和 y 进行比较。我正在处理的问题要求我设置它,以便鼠标的二次单击会在放置在其上时删除一个点,我想我可以通过比较圆坐标和鼠标坐标的
我正在尝试将图像中的几个点转换为 OpenCV 中的极坐标。我遇到了名为 cartToPolar 的函数,它会为我的点提供相对于 0,0 作为我的原点的极坐标。但是,我想通过将图像中的另一个点作为原点
是的,我想知道如何检查某个坐标是否在另一个坐标半径内。但这可能是一个很小的差异,因为纬度、经度、半径存储在数据库中,而我们要检查的只是给定的坐标。 示例 数据库表 name | lat
我正在使用带有图层的 map (来自示例): var lonLat = new OpenLayers.LonLat(40.4088576, -86.8576718) .
我在坐标转换方面遇到了一些麻烦。 我在屏幕上有一个已知坐标(x,y)的对象,我想将其转换为世界坐标(x,y,z),因为它会投影在相机的近平面上。 到目前为止,我可以像这样在Z平面上进行投影: var
我有4个足球场点(角点): P1(lat, lon, alt) , P2(lat, lon, alt) , P3(lat, lon, alt) , P4(lat, lon, alt) . 以及球场上的
我有一个交换了纬度和经度位置的 NetCDF 文件。 我通常使用的 Netcdf 的标准方式定义如下: Coordinates: * time (time) datetime64[n
如果 line1 和 lin2 都由 x,y,alpha 定义,其中 x,y 是直线上一点的坐标,alpha 是直线与 x=const 之间的角度,如何找到 line1 和 lin2 相交的点? 我尝
我是一名优秀的程序员,十分优秀!