Jump to content

detect if primitive is in field of view - how to ?


nmn

Recommended Posts

Hi everyone,

is there a way to detect if a primitive is seen by certain camera (in SOPs) ?

one way could be by using a virtual pyramid (representing the field of view) maybe ? then checking if the primitive is inside ?

but i feel this could be very non efficient ...

any light shed on this subject would be very appreciated

Thanks in advance

Cheers

Link to comment
Share on other sites

lol thanks rdg, i discovered that and then i came back to put it and saw that you beat me

thanks anyway for the help, if there are any other methods i would like to know also :)

Cheers

Edited by nmn
Link to comment
Share on other sites

The way Massive does it is by rendering a low resolution image and doing analysis of the pixels. That way you get obstruction as well (object behind a wall, but within frustrum), but it is more costly than "hearing", which is a spherical distance calculation. I think if I remember correctly that you can open a pointcloud and also specify a direction with it. So rather than a spherical lookup, you will get a cone. But I have not used the pcopen vex function in this way.

Not sure how to exactly go about a feedback loop that would include and analyze rendered images "as you go". My knowledge of cops is not extensive enough. In dops & sops it would be possible with a ray sop and a grid. Each point on the grid would represent a pixel. This grid is parented to the camera (and would be similar to a front clipping plane), the raydirection would be from the camera to each point on the grid and then into the scene. You would probably also need a maximum distance or add a far clipping plane. You can probably speed the whole thing up in a vopsop.

What you then do with the resulting grid is up to you. Massive uses analysis of bright colors to analyze friend (eg. green ) or foe (eg.red) and how much pixels or green or red, left, right or center and how to blend ramps which control behaviour based on the amount of pixels.

I would check the point cloud technique first as it will probably be fast (multithreaded).

Link to comment
Share on other sites

Thanks Peter for the information about the different approaches , very helpfull

i think I will stick with the UV approach for now, it is sufficient for what i need

but it was very good to see the different possible ways to handle such a thing.

Thanks again

Regards

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...