有什么方法可以在屏幕上获取图像或对象的当前坐标? [英] is there any way to get the current co- ordinates of an image or object on screen?

查看:94
本文介绍了有什么方法可以在屏幕上获取图像或对象的当前坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以获取屏幕上图像或对象的当前坐标?我想将它们用于更多动画而不进行计算.

is there any way to get the current co- ordinates of an image or object on screen? i want to use them for more animation without calculating.

推荐答案

什么方法"?您始终拥有它,因为您知道Window的坐标和相对于控件的图像.此外,您永远不需要相对于屏幕的坐标,而总是可以使用相对于包含动画的控件的坐标.

因此,您拥有了一切……除非您执行无需计算就可以进行动画处理".坦白说,听起来像没有编程的OpenGL",没有操作系统的计算机"和没有新娘的婚姻".

—SA
What "way"? You always have it as the coordinates of a Window and an image relative to a controls are known to you. Moreover, you never need coordinates relative to screen, you always can use coordinate relative to a control containing animation.

So, you have everything… unless you do "animation without calculating". Frankly, is sounds like "OpenGL without programming", "computer without operating systems" and "marriage without a bride".

—SA


亲爱的,

是否要在3D世界中选择对象或图像?
如果是这样,则需要实现光线跟踪,可以在Web上进行搜索.

使用此技术,无论您在屏幕上的何处单击,都将发射无限的光线(矢量),并且该光线将碰撞的第一个对象将在3d世界中被选中.然后,您必须将对象从3d坐标系转换回屏幕坐标系,以获取准确的对象选择.

希望对您有所帮助!

欢呼声,
tushar
Hi sweety,

Do you want to select the objects or images in 3d world??
If so you need to implement the ray tracing, You can search it on web.

Using this technique, wherever you click on the screen , a infinite ray (vector)will be fired and the first object the ray will collide will get selected in 3d world. Then you will have to translate the object back to the screen coordinate system from the 3d coordinate system to get the exact object selection.

Hope this might help you!

cheers,
tushar


这篇关于有什么方法可以在屏幕上获取图像或对象的当前坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆