Thanks Brent.

On 2012/06/12 12:39 PM, Brent McPherson wrote:

Hi Jared,

I can think of one easy way to do this with the tool SDK.

The tool can call Pick using rectangle raycast to quickly get a list of objects (or components) that are visible in the view.

Of course, this would require you to use a tool but you could have the tool exit after it builds the list.

The PickTestTool example that ships with Softimage is a good place to start and here is the code to pick everything visible in the view using rectangle raycast:

                CRefArray visible;

                CLongArray l_points;

                LONG x, y, width, height;

                CStatus GetViewport( x, y, width, height );

                l_points.Add( x );

                l_points.Add( y );

                l_points.Add( x + width );

                l_points.Add( y + height );

in_ctxt.Pick( l_points, siPickMultipleObjects,siPickRectangleRaycast, L"", CRefArray(), visible );

                if ( visible.GetCount() > 0 ) {

                     // etc...

Hope this helps.

--

Brent

*From:*[email protected] [mailto:[email protected]] *On Behalf Of *Jared Glass
*Sent:* 12 June 2012 08:02
*To:* [email protected]
*Subject:* Get objects visible by camera

Hi
I know this may be a bit ambitious but I am looking for a way to get all the objects or a count of faces visible by the camera. I don't want all the objects within the camera's near and far clip planes because some objects may not be visible due to being behind other objects and therefore will not contribute to render times. I've done a bit of research and so far the simplest solution looks like I'd need to write my own simple ray-tracer which emits rays from the camera and then returns the objects that the rays hit...though I must admit with my current programming and xsi knowledge this is a bit over my head (for now ;)

Can anyone point me in the right direction, or does someone have any idea how I could acheive this please?

--
Kind Regards,
Jared Glass <mailto:[email protected]> | Technical Lead
Triggerfish Animation Studios <http://www.triggerfish.co.za>
Zambezia Movie <http://www.zambeziamovie.com/> | Khumba Movie <http://www.triggerfish.co.za/khumba/>



Reply via email to