Returning y value from 1D array of 'vector 3's

Started by
1 comment, last by freeworld 12 years, 11 months ago
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

Advertisement
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[ ][ ][ ]?
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.

This topic is closed to new replies.

Advertisement