Skip to content

I have a couple of questions... #19

Description

@kdschlosser

I know this is a new library and there isn't any documentation for the library as of yet so I have a couple of questions...

I am going to give a general layout of the application I am writing so you can get a little bit of a working knowledge of what I am wanting to achieve.

I am working with OpenGL (PyOpenGL) to render triangle meshes to the screen. the models themselves are sometimes loaded from file and sometimes they are created on the fly. The information that is available from these models is a numpy array of the triangles that has the shape of N, 3, 3 and from that normals are generated which has the same shape as the triangle array. I also calculate the bounding box of the mesh for use in performing a hit test to be able to select object. What I need to do is I need to cull the objects using the camera frustum planes. and then cull the remaining triangle meshes at the triangle level once again using the camera frustum planes. From there I need to add all of the triangles together into a single array and sort those triangle by distance from the camera in far -> near order. While this is being done the normals need to be also sorted so they stay in alignment with the vertexes for the triangles. The application I am writing can have over 500 triangle meshes ("objects") and each of the objects can contain anywhere from a few hundred triangles to 30000 triangles and possibly more. I do not want the GPU wasting time rendering triangles that are not in the viewing area which I believe that OpenGL handles that internally but the triangles that are in the viewing plane but cannot be seen are what is not handled. I also need to handle the order by distance because objects may intersect other objects and when an object is clicked on if there is an intersection the intersected object will become translucent so positioning is able to take place easier. When using the alpha channel in order to have the blending done properly by OpenGL the triangles need to be ordered far -> near. This process needs to be as fast as possible. I have some code that does this but it takes too long, roughly 1/2 a second to sort 10 million triangles returning 10% of them. 1/2 a second is not going to allow for smooth movement.

Will this library have the ability to handle something like that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions