pin calls gfunction right away, which leads to unordered faces by default (if I understood this correctly). sortfaces! resolves that, but I think this can be automated by (priority) queuing. Instead of calling gfunction, its call could be queued and that queue stored in a struct. A final pin call on that object then draws everything. Something like:
# queues based on distance from eyepoint
pq = SomeQueue(eyepoint)
# queues gfunction calls - both functions and parameters - instead of actually calling
pin.(pq, [Point3D(randn() * 50, randn() * 50, randn() * 50)
for x in 1:75, y in 1:75, z in 1:75])
# call all gfunctions in order of priority
pin.(pq)
A drawback would be that the eyepoint has to stay fixed for the queue's whole lifetime, but that's not too bad.
pin
callsgfunction
right away, which leads to unordered faces by default (if I understood this correctly).sortfaces!
resolves that, but I think this can be automated by (priority) queuing. Instead of callinggfunction
, its call could be queued and that queue stored in a struct. A finalpin
call on that object then draws everything. Something like:A drawback would be that the eyepoint has to stay fixed for the queue's whole lifetime, but that's not too bad.