lock last selection renderpick dat?

I’m wondering if a new parameter could be implemented for the renderpick dat that when engaged will maintain the selection of an object even if the cursor moves off the selected object. Basically I’m finding if you move the mouse (or touch) too quickly while using the renderpick dat to drive the object’s position the cursor will not longer be over the object and I’ll lose the pick. I can think of a couple of ways to deal with the problem but it would be much easier if it was just part of the way the renderpick DAT worked. is this possible?

My current idea would be to have on large object behind the forground moving objects that would always be picked when selecting any other object and then use the background objects picked translate values to move the last foreground object selected.

any other ideas?
thanks
Keith

Could you use the “Hold last Picked” option in the Strategy parameter?

Thanks Markus I tried that also but it doesn’t work. Even though it doesn’t clear the table (row) after the object is no longer picked it also doesn’t update the values. It would work perfectly if it continued to update the values. Below is just simple example.

thanks
Keith
renderPickObject.3.toe (10.4 KB)

But the issue is that the RenderPick is not really selecting an object, its reporting which object is under the cursor.
So if the cursor moves off the object, its not clear what real-world position (tx,ty,tz) to use as its over empty space.

A different approach is to use a Panel Execute DAT on the container itself, to monitor the select variable, on-to-off, and off-to-on.
When select is pressed, sample the results of the RenderPick to see which if any object it is over, and store any starting coordinates etc.

Next you’ll have to define how changes in u,v will map onto changes in tx,ty,tz.
Proper way to do this is to use mapping/projection functions.
Simple way to do this is assume an orthographic projection and scale u,v to get a new tx,ty.

-Rob

Thanks Rob! I didn’t really understand how the renderpick was working.

In this case using an orthographic projection won’t work but I think creating a function to convert from screen space to world space shouldn’t be too difficult if I can access the projection matrix from python. Which I thought I read was possible? I’ll look into it.

thanks for the tips
keith

a simpler approach might be to run a parallel renderpick DAT with a single geometry grid at the depth you require filling the entire view.
Then you’ll be able to pickout the x,y,z from that in your calculations.

There wasn’t a way to get the projection matrix from a Camera COMP in Python, but there is now. It’ll be in build 12090 or later.

That is great news!!! I had some other plans where I was going to need a camera’s projection matrix as well. Awesome!

thanks
Keith

The Render Pick DAT has one row per finger that is pressed (or the mouse clicks if you are just using a mouse).

Create another table with one row per object where you stuff values when you select and object, and subsequent values when you drag around.

To get values into the new table, attach a DAT Execute DAT to the Render Pick DAT and when rows change, check what’s selected and stuff values in the new table.

Thanks Greg! Seems like the simplest solution. I’ll give it a try. Also thanks guys for making a camera projection matrix available in the newest build. That’s awesome.

cheers
Keith