Jump to content

once apon a time far far away....clip points by camera view


Recommended Posts

Hi,

Once Upon a time far far back in the old houdini, I saw a example of someone clipping all the point that are not in the viewport.

Now I know it is possible with volumes. but I need a node / way that does that on points (for example Instances)

Does anyone know?

THNX :)

 

Link to comment
Share on other sites

in an attribWrangle:
 

vector _ndc = toNDC("/obj/cam1", @P);

float _errorx = ch("errorx");
float _errory = ch("errory");
float _errorz = ch("errorz");

if ((_ndc[0] < 0 - _errorx) || (_ndc[0] > 1 + _errorx))   removepoint(geoself(), @ptnum);
if ((_ndc[1] < 0 - _errory) || (_ndc[1] > 1 + _errory))   removepoint(geoself(), @ptnum);
if ((_ndc[2] > 0 + _errorz))   removepoint(geoself(), @ptnum);

update the path to your camera, then set your error margins accordingly

  • Like 5
  • Thanks 1
Link to comment
Share on other sites

38 minutes ago, iamyog said:

in an attribWrangle:
 


vector _ndc = toNDC("/obj/cam1", @P);

float _errorx = ch("errorx");
float _errory = ch("errory");
float _errorz = ch("errorz");

if ((_ndc[0] < 0 - _errorx) || (_ndc[0] > 1 + _errorx))   removepoint(geoself(), @ptnum);
if ((_ndc[1] < 0 - _errory) || (_ndc[1] > 1 + _errory))   removepoint(geoself(), @ptnum);
if ((_ndc[2] > 0 + _errorz))   removepoint(geoself(), @ptnum);

update the path to your camera, then set your error margins accordingly

Is this a quicker approche in multithreading than the rest?
And where to put this? ( wrangles are getting better and better, but still learning)

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...