directx - 3D Graphics Picking - What is the best approach for this scenario -


i working on project allows users pick 3d objects in scene , wondering thought best way approach particular scenario.

basically have scene @ least 100 objects (they low-poly made @ least ~12-15 triangles) , 1000-2000 objects.

not objects "pickable" @ times because objects occlude others "pickable" objects land in range between 800-1500 (depending on complexity of scene).

when object "picked" want highlighted in way means rendering differently, trivial want picking done not on single clicks drags - means want run picking algorithm lot in short space of time. ideally user see objects highlighted while still in "drag" operation - (meaning picking should done asynchronously not lag main rendering?).

i have tried simple ray trace picking quite slow loop through triangles in scene find object.

i have tried gpu-based picking - rendering scene using pixelbuffer gives unique color each object dragging operation means multiple renders , gpu-to-cpu data transfer doesn't have great performance.

are there other possibilities explore try , performance , functionality want?

thanks time.

i have used octree before sort of thing , seemed best option. every object can placed in corresponding node , tested through usual octree protocol. real benefits come offsetting ray cast end of spatial node when current node empty. surely give significant gains on brute-forcing it.

the following link should give base octree's , how set up: introduction octrees

while link giving base, use of octree reducing necessary checks, judging question, seem have knowledge required perform actual picking.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -