Quote:
Originally Posted by Powerlord
Rotating by degrees implies a 2D plane rather than a 1D set of values.
|
Perhaps i should explain what i want to do.
Well, inside the array the are vertex indices.
I have mesh what have already 2 indices arrays inside of it.
one is sorted near >= far in x axis and the other one is sorted near >= far by y axis.
I'm not sure if you guys know that but in order to draw complex transparent mesh the triangles needs to be sorted, other ways you will see weird results.
we already know what we have in indices array when angle is 90,270, 0, 180 but now i need a formula what predicts the order when angle is something what i haven't listed.
Somehow i feel it can be done but im not quite sure.
It is really annoying and cpu waste if i need to sort vertices by their distances each time the angle changes.
1. checking float/double is much more slower than checking ints ( not sure why )
2. you will have 3 variables to deal instead of one linear array what i wish.
3. in order to calculate distance in 3d i must use square root but calculation square root is also taking much cpu power.
When i say much cpu power then i meant something like:
1-5000 times per frame is okay but 100 000 - 1 000 000 is just omg
It is rare case if i have more than 100 000 transparent triangles but hey, who knows what i wish to do
with my engine and i also wish that it would work as fast as possible.