Relative Content

Tag Archive for c#3d

How to use VBO to draw objects

I have data stored in an object file. It consists of vertex, normal, and face data. I have loaded the data into 3 vectors. two vector where each element represents a 3-element vertex/normal, and one vector<vector> where each vector represents a face and has 6 elements which index into the other vectors as follow [normIdx, vtxIdx, normIdx, vtxIdx, normIdx, vtxIdx]. I am currently using glBegin(GL_TRIANGLES) and looping over the faces to draw the vertices. I want to modify my code to use a VBO to improve its efficiency.

Closest point on a complex 3D object to a specified point?

If I have a complex 3D model (provided as a Wavefront OBJ file, all faces are triangles) and a point in the same space, how can I find the closest point on the surface of the model? I’m interested not only in (X, Y, Z) but also corresponding interpolated (U, V) values. The model is not strictly convex. I’m working in C#. Are there any premade libraries that can do this, or am I going to have to implement it myself?