polyscope icon indicating copy to clipboard operation
polyscope copied to clipboard

Rendering issue with visualisation

Open Edisuism opened this issue 3 months ago • 3 comments

Thank you for the tool,

I have been having issues with the VectorQuantities, PointClouds and CurveNetworks in that they seem to have some weird rendering artifacts. It is a bit hard to describe so I have attached a recording of it. It looks to be only rendering elements that are a fixed distance from the camera.

In the video, the expected visualisation is a crossfield on each face of the ellipse as well as normal vectors along the principal axis (essentially along the x and y).

Any suggestions for how to address this would be greatly appreciated!

https://github.com/user-attachments/assets/05dd1d50-b620-4b76-8bf8-2ff8a6bd2a6d

Edisuism avatar Oct 27 '25 22:10 Edisuism

Hi, thanks for reporting.

This is wild, something is definitely going very wrong, but I've never seen this one before.

Can you share any more details that might give a hint? What are the details of your machine/environment? Are you doing anything else funky in the program? Are there any errors printed to console? There's also a enableRenderErrorChecks option that will do some additional checking.

nmwsharp avatar Oct 28 '25 04:10 nmwsharp

Thanks for the reply.

I'm on Ubuntu 24.04.2 LTS. I enabled the error checks option and only got the following output

[polyscope] Backend: openGL3_glfw -- Loaded openGL version: 4.3 (Core Profile) Mesa 25.0.7-0ubuntu0.24.04.1

Not doing anything in the program that tweaks the rendering or involves any animation. Below is an example call to visualise some vector quantities. Otherwise, do you know what other info may be useful to troubleshoot?

auto* edges_list = delaunay_->m_init_mesh_->get_edges_list();
std::vector<std::array<double, 3>> edge_midpoints;
std::vector<std::array<double, 3>> edge_tangents;

for (auto* e : *edges_list) {
    if (e->face) { 
        Eigen::Vector3d midpoint = 0.5 * (e->vert->pos + e->pair->vert->pos);
        Eigen::Vector3d tangent = e->tangent.normalized();
        Eigen::Vector3d face_normal = e->face->normal.normalized();

        if (tangent.dot(face_normal) < 0) {
            tangent = -tangent;
        }

        edge_midpoints.push_back({midpoint.x(), midpoint.y(), midpoint.z()});
        edge_tangents.push_back({tangent.x(), tangent.y(), tangent.z()});
    }
}

if (!edge_midpoints.empty()) {
    auto* pc_edges = polyscope::registerPointCloud("Edge Tangent Midpoints", edge_midpoints);
    pc_edges->setPointRadius(0.0002)->setEnabled(true);
    pc_edges->addVectorQuantity("Edge Tangents", edge_tangents)
        ->setVectorColor(glm::vec3(1.0f, 0.5f, 0.0f)) // Orange
        ->setVectorLengthScale(0.03)
        ->setEnabled(true);
}

Edisuism avatar Oct 28 '25 06:10 Edisuism

I have reset my OS environment in attempts at a fix but to no success. What I have found is that changing the camera parameters to orthographic projection makes the vectors and curve networks visible. Changing the camera parameters while in perspective projection does not solve any issues.

Image

Edisuism avatar Oct 29 '25 08:10 Edisuism