Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :Lbl SortFaces
- :...
- :r1→pointer on table of rotated 2-bytes Z of each vertices in the faces
- :r2→pointer on faces array
- :r3→output area,which contains at least 1 byte for each face
- :returns the sorted order in outputArea
- :...
- :.Z-average of each face
- :For(r4,0,{r2-1}-1)
- :0→{r4*2+L4→r6}^r
- :‾1
- :For(4)
- :+1→r5
- :{{r4*4+r5+r2}*2+r1}^r+{r6}^r→{r6}^r
- :r5
- :End
- :End
- :
- :.Init sorting
- :For(r4,0,{r2-1}-1)
- :r4→{r4+r3}
- :End
- :
- :
- :.Sort
- :While 1
- :0→r6
- :For(r4,0,4)
- :If {{r4+r3}*2+L4}^r<<{{r4+r3+1}*2+L4}^r
- :1→r6
- :{r4+r3}^r→{r4+r3}^r^r
- :End
- :End
- :End!If r6
- :Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement