Thebes.jl icon indicating copy to clipboard operation
Thebes.jl copied to clipboard

Queuing gfunction calls based on eyepoint distance

Open schneiderfelipe opened this issue 3 years ago • 0 comments

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.

schneiderfelipe avatar Jan 08 '21 17:01 schneiderfelipe