i'm having a problem finding a cheap way to make a pattern based on a 3d position
Code: Select all
If (bx And 3) And (by And 3) And (bz And 3) Then
algorithm A, visibility check that is unfriendly towards adding more faces
algorithm B, visibility check that is friendly towards adding more faces
is the code to determine wether or not a specific face (important!) will be visible in a tree
so, there can be 6656 faces in a sector, potentially (16, 8, 16 blocks)
unfriendly means it won't add a face there if theres a leaf-block on the opposite end
friendly means it assumes theres no faces in that position already and adds it even if a leaf-block could potentially be there
1. my algorithm must not create aliasing (faces in the same position)!
2. it must me seamless against neighboring sectors, ie. the pattern cannot use odd numbers!
3. the outer edges of trees are always solid! that's taken care of!
i used to have the algorithm if (bx + by + bz) and 1 then
but it only removed every 2nd face, and thus every face would still be there (consider the opposite block!) :)
all it did was fix aliasing
EDIT: to make sure we are talking about the same thing, here is a tree :P
as you can see my current version creates corridors, which is bad :(