How to use advection? #1332
Unanswered
alessandroAM
asked this question in
Q&A
Replies: 1 comment
-
The code you're sharing here doesn't appear to add any points to the points grid - are you doing this outside of this snippet? I suggest starting out looking at the "Hello World" example in the docs if you haven't already - https://www.openvdb.org/documentation/doxygen/codeExamples.html#sPointsHelloWorld that creates a handful of points based on world space position. You should also not use the
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, after following a partial example here: [https://www.openvdb.org/documentation/doxygen/codeExamples.html#sModifyingGrids] (Advecting Points section), I've been trying to implement advection using a gravity velocity field. The resulting vdb is just the initial one, and I can't understand what I'm doing wrong. There is really little information around, anyone can help me? Here is the code I've so far:
openvdb::points::PointDataTree::Ptr pointTree(new openvdb::points::PointDataTree(grid->tree(), 0, openvdb::TopologyCopy())); openvdb::points::PointDataGrid::Ptr points = openvdb::points::PointDataGrid::create(pointTree); // get the PointDataGrid from the initial FloatGrid auto gravity = openvdb::Vec3SGrid::create(openvdb::Vec3s(0, -9.81, 0)); // Create an empty velocity grid with gravity as background value openvdb::points::advectPoints(*points->create(), *gravity, 4, 1.0 / 24.0, 1000); // Advect points in-place using gravity velocity grid
Thanks for any suggestion.
Beta Was this translation helpful? Give feedback.
All reactions