samo

Hi Peter,

Few days back i was thinking about doing something like what you did in the image below on the other post.

So i was wondering what was your approach? My first approach was to use vdb, i wanted the viewing frustum to effectively delete all the polygons that are outside a given shape (like a scanned mesh), and eventually doing some other operation like using the "smartPolyFill".
On a general note how can extract this camera data?

 

thanks
[camera_ocean]

 

Reply 0 0
pshipkov
Check the attached scene. It is one expression.
This is the easy, high-level, way of doing it.

Let me know if you need the C++ API implementation as well.
Reply 0 0
samo

thanks for the file

ok i see, i was wondering at the beginning if it was a mesh shape or an actual node gathering the camera frustum like in one of Houdini VDB node (haven't checked if maya VDB from Besha is having this option).

So i give it a try, but overall on heavy meshes it's not ideal, i also gave it a try on houdini to check the performance, it was just a little bit better.


One question though, in this test i have used the Mash falloff node which is working just fine with a custom shape, and you can feed the input component of the delete node with it like you would do with soup.
Now regarding soup when we want an input geometry for the bounding object, it creates these tiny bounding objects on every vertex.

So in this case with a square shape it doesn't really work as expected unless you have very subdivided shape to cover the space.

Is there a way with soup to have a real custom bounding box even with just 4 vertices?

thanks   




Reply 0 0
pshipkov
In the scene i provided the frustum is represented with a mesh object and controlled by a simple expression. It is very lightweight by itself, but i guess you want to "clip" other geometry with it if not mistaken, correct ?

If you are looking for just the visual representation of the frustum it can be implemented as a MPxLocatorNode. I think there was a SPI open source project out there that can do this, or you can code your own - it is pretty straightforward.

To answer your last question - actually there is a proper "volume" based detection method in SOuP, that does not require you to sample on the bounding object's points, which is the default behavior of the boundingObject nodes. In fact there are multiple ways to do that.
Take a look at the "cage" node. By default it outputs face components. You can convert them to other component types using componentToComponent node.
Also, take a look at the pointsOnMeshInfo node - it can detect points located inside the volume of other objects as well.

If not completely clear how to get it working - let me know - i will try to give you more clarity and dig out some example scenes (this subject came at least few times in the past, if memory serves well).

The best, from performance stand-point, way is to actually generate the mesh data in camera space, so you don't need to delete from heavy data set, but generate the reduced data set directly. Obviously, this is a lot more involing approach.

Thanks.
Reply 0 0
besha1
If you want use frustum for vdb try BE_VdbClip node in mode camera.
Reply 0 0
pshipkov
Ah, yes. This is in the OVDB plugins as well. Forgot to mention that myself.
Thanks for the clarification.
Reply 0 0
samo

thanks for the VDB confirmation.

 

ha yes the "cage" node is effectively using the shape of the mesh like the fall off node, but it's really really slow.  

Reply 0 0
pshipkov
Try the pointsOnMeshInfo - it is pretty fast.
Reply 0 0
samo

ok so i tried the "pointsOnMeshInfo" the point detection inside the shape is working as expected. 

But i'm hitting an issue here, the outPositionPP of the "pointsOnMeshInfo" is giving me new points and they have new ids (which make sens i guess) so if i try to use a group node to control let's say an extrusion on a shape it starts from the id number 0 of the mesh.

So is there a way to keep the same ids? Tried to use the "Point" node i saw that there was and $ID variable but i'm probably missing something here.

thanks  

[Os5K1a]

Reply 0 0
pshipkov
Ok, grab this SOuP build for Maya2018 on Windows: http://www.petershipkov.com/temp/SOuP.zip
And check the attached scene. This way everything is integrated and clean.
This update to the group node will be in the next release as well.

If you insist on using the official SOuP release - let me know and i will provide you with another scene that achieves the same using 2-3 more nodes.

Thanks.
Reply 0 0
samo

ha thank you very much.

If you have time i would still be curious how you would do it with the 2-3 more nodes, just out of curiosity. (or briefly explain the methodology) 

 

Reply 0 0
pshipkov
Sure.
Check the attached scene - it shows one way of mapping the data.
This one is a bit obscure since i am using some local variables of the arrayExpression node.

Another, more explicit approach, will be to map the data using the kdTree node.
Reply 0 0
samo
it's interesting to see that this last one with the weight map is operating significantly faster. 
Reply 0 0
Reply