English 中文(简体)
利用缓冲选择物体:准确性问题
原标题:Using a buffer for selectioning objects: accuracy problems
  • 时间:2011-01-26 07:32:30
  •  标签:
  • opengl

in each frame (as in frames per second) I render, I make a smaller version of it with just the objects that the user can select (and any selection-obstructing objects). In that buffer I render each object in a different color. When the user has mouseX and mouseY, I then look into that buffer what color corresponds with that position, and find the corresponding objects. I can t work with FBO so I just render this buffer to a texture, and rescale the texture orthogonally to the screen, and use glReadPixels to read a "hot area" around mouse cursor.. I know, not the most efficient but performance is ok for now.

现在我的问题是,这种带有“col物体”的缓冲存在一些准确性问题。 当然,我对所有照明和束缚器都置之不理,但我仍有一些手法。 显然,我确实需要无任何差异的有色谱。

“Screenshot

请注意,我在此把所有彩色信息放在L_RED的未经签名的书中。 (目前,我最多拥有255个可选择物体)。

Are these caused by rescaling the texture? (I could replace this by looking up scaled coordinates int he small texture.), or do I need to disable some other flag to really get the colors that I want. Can this technique even be used reliably?

最佳回答

它希望你重新使用<代码>。 www.un.org/Depts/DGACM/index_french.htm http://www.opengl.org/sdk/docs/man/xhtml/glTexPara amount.xml”rel=“nofollow”GL_NEAREST 相反,如果你不想要干涉肤色。

问题回答

我可以取代这一点,在小案文中寻找经扩大的坐标。

你应该这样做。 修缮费用比将坐标作肯定。

尽管如此,如果你保持低温(如2x级)而不进行低温过滤,那么扩大统一案文就不应引入手工艺。 它看着多角边缘的模糊,因此我假定这并非你所使用。

此外,重新计算只应在多角边界上带来变化。 您是否检查了无改动的案文? 这将确认它是否采用了你的“知识”。

What exactly do you mean by "variance"? Please explain in more detail.

现在有一些建议: 如果您的成衣不依赖静态的缓冲行动,你可将物体识别器放在向窗户本身穿透的天候缓冲器中,不要使用单体。 在目前的硬件上,通常有8个sten。 当然,如果你想要使用指数缓冲办法,那么最佳解决办法是使用多重目标,使物体识别成为一种指数缓冲,加上一张通行证中的颜色和其他 st。 见





相关问题
OpenGL 3D Selection

I am trying to create a 3D robot that should perform certain actions when certain body parts are clicked. I have successfully (sort of) implemented picking in that if you click on any x-plane part, it ...

CVDisplayLink instead of NSTimer

I have started to implement cvDisplayLink to drive the render loop instead of nstimer, as detailed in this technical note https://developer.apple.com/library/archive/qa/qa1385/_index.html Is it ...

Can the iPhone simulator handle PVR textures?

I have a really weird problem with PVR textures on the iPhone simulator- the framerate falls through the floor on the iPhone simulator, but on the iPhone itself it works just fine. Has anyone had any ...

Calculate fps (frames per second) for iphone app

I am using an opengl es iphone application. What is the most accurate way to calculate the frames per second of my application for performance tuning?

Java - Zoom / 3D Data Visualization Libraries

What are the best libraries/frameworks for doing 3D and/or Zoom interfaces in Java? I d like to be able to do some prototyping of creating new types of interfaces for navigating within data and ...

FLTK in Cygwin using Eclipse (Linking errors)

I have this assignment due that requires the usage of FLTK. The code is given to us and it should compile straight off of the bat, but I am having linking errors and do not know which other libraries ...

热门标签