Sign in to follow this  
Altemia

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

Recommended Posts

Altemia    100
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

Share this post


Link to post
Share on other sites
jyk    2094
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?

Share this post


Link to post
Share on other sites
freeworld    341
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[ ][ ][ ]?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this