1

I have built a VR arena for a fly. Inside the VR world, a fly flies which has objects in it. The VR world is actually built using Panda 3D game engine. I record the trajectory of the fly. I obtain position (x,y) and heading (theta) as function of time.

Briefly, what I am trying to do is, get a heatmap of what the fly saw as it flew. The heatmap is a representation of the world with intensities corresponding how often they were visible to the fly. The more often a fly stared at a particular place by flying towards it, the hotter those regions get. The trajectory plot only explains the path as if the fly was just a point. It doesn't convey what the fly saw as it flew. The fly sees the virtual world based on the VR camera parameters. It has a field of View (FOV), max draw distance and orientation (heading). So as it traverses through the world, it basically sees a sector (pie shaped wedge) of the entire world.

What I want to implement is a method to keep a count of how many frames each point on the map came inside the camera's FOV (the sector).

This naively results in a sector traversing along the trajectory and incrementing a counter at all those points inside the sector. After this entire traversal, All I need is to plot this matrix as a heatmap. This is what I think is a fair representation of what the fly saw mostly in it's trajectory.

Conceptually, the task is doable with multiple for loops. But I am not sure how to go about implementing this as a vectorized form so that it can happen in a lifetime. I am using python

0 Answers0