I have a vector 3 (x,y,z) 1D dynamic array full of vertex positions.
How would I return the y value at a given x and z coordinate?
Using C++ and compiling in Visual Studio 2008
Returning y value from 1D array of 'vector 3's
I don't think there's enough information there to answer the question. What do the vertex positions represent? Are they mesh vertices? Do you also have a set of triangle indices available?
Unless your x n z combination values are completely unique... ie there is never a duplicate, you can't. Is what you described what you're actually trying to do? Ie are you looking for
float y = Array.GetY(x, z);
Or are you trying to use a 1D array to rpresent a 3D array... ie Array[ ] instead of Array[ ][ ][ ]?
float y = Array.GetY(x, z);
Or are you trying to use a 1D array to rpresent a 3D array... ie Array[ ] instead of Array[ ][ ][ ]?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement