nmn Posted January 17, 2010 Share Posted January 17, 2010 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 Quote Link to comment Share on other sites More sharing options...
rdg Posted January 17, 2010 Share Posted January 17, 2010 Another way is to project UVs from the camera and promote them to primitives. Quote Link to comment Share on other sites More sharing options...
nmn Posted January 17, 2010 Author Share Posted January 17, 2010 (edited) 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 January 17, 2010 by nmn Quote Link to comment Share on other sites More sharing options...
pclaes Posted January 18, 2010 Share Posted January 18, 2010 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). Quote Link to comment Share on other sites More sharing options...
nmn Posted January 19, 2010 Author Share Posted January 19, 2010 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.