Skip to content

Commit

Permalink
add volume grid layout test to demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
nmwsharp committed Dec 24, 2023
1 parent 9f8a0a5 commit 07c5695
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/demo-app/demo_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,13 +480,27 @@ void addVolumeGrid() {
return (glm::length(q) - t.y) * scale;
};


polyscope::VolumeGridNodeScalarQuantity* qNode =
psGrid->addNodeScalarQuantityFromCallable("torus sdf node", torusSDF);
qNode->setEnabled(true);

polyscope::VolumeGridCellScalarQuantity* qCell =
psGrid->addCellScalarQuantityFromCallable("torus sdf cell", torusSDF);
qCell->setEnabled(true);

// use this to check ordering thing
auto xCoord = [](glm::vec3 p) { return p.x; };
auto yCoord = [](glm::vec3 p) { return p.y; };
auto zCoord = [](glm::vec3 p) { return p.z; };

polyscope::VolumeGridNodeScalarQuantity* qNode_X = psGrid->addNodeScalarQuantityFromCallable("node X", xCoord);
polyscope::VolumeGridNodeScalarQuantity* qNode_Y = psGrid->addNodeScalarQuantityFromCallable("node Y", yCoord);
polyscope::VolumeGridNodeScalarQuantity* qNode_Z = psGrid->addNodeScalarQuantityFromCallable("node Z", zCoord);

polyscope::VolumeGridCellScalarQuantity* qCell_X = psGrid->addCellScalarQuantityFromCallable("cell X", xCoord);
polyscope::VolumeGridCellScalarQuantity* qCell_Y = psGrid->addCellScalarQuantityFromCallable("cell Y", yCoord);
polyscope::VolumeGridCellScalarQuantity* qCell_Z = psGrid->addCellScalarQuantityFromCallable("cell Z", zCoord);
}


Expand Down

0 comments on commit 07c5695

Please sign in to comment.