Why are there no #3d #visualization tools (for #python) that work like a #gamedev engine? I want to do more than rotate and zoom. I want to translate my rotation point. I want to walk around inside my #data. Let me explore parameter space directly.

If it doesn't already exist, maybe I'll have to make my own #fps style plotting tool.

Some prior work

siggraph 2019 had something, but the info link is broken. In any case, it seems to be more about modeling/sim:
https://blog.siggraph.org/2019/10/scientific-visualization-in-game-engines-get-to-know-the-2019-undergrad-student-research-winner.html/

Even earlier is something that seems to be going in exactly my direction, but didn't go very far
https://sites.psu.edu/bdssblog/2017/04/06/basic-data-visualization-in-unity-scatterplot-creation/

I played a lot with #pyqtgraph recently, but I can't remember if you can move the zoom/rotate center. If not, I have a project ahead of me...?

Scientific Visualization in Game Engines: Get to Know the 2019 Undergrad Student Research Winner - ACM SIGGRAPH Blog

Jasmine Shih shares how she developed "Interactive Cinematic Scientific Visualization in Unity 3D," the winning undergraduate project at the 2019 ACM Student Research Competition.

ACM SIGGRAPH Blog
@davidr I think to move your center, you effectively need to move everything else. Generally I wouldnโ€™t say the 3D capabilities of #PyQtGraph are as competitive as other offerings like #VisPy or #GlumPy. If neither package works than I would think doing something with the Blender API might be more suitable

@ogi Somehow never came across (or forgot about) #glumpy.

#vispy always seems promising until I get to the "our plotting is very basic". I'm doing plots, not vis typically.

Thanks for the tip!

Also, I still really love #pyqtgraph. As I mentioned a few months ago I buckled down and learned it better. I started a newish project at work and I want to use it to plot with. It isn't just the features, it's also the relatively short dependency list. That can be a dealbreaker in my environment.

@davidr 3D is just not where #PyQtGraph sets itself apart, it is still useful for integration and interactivity bits, but its render performance can't compete with some of the other libraries that use hardware acceleration.

Glad to hear #PyQtGraph has been useful for your work!

@ogi I looked at the #pyqtgraph code and docs a little but haven't tried anything yet.

3D line and scatter plots are all based on GLGraphicsItem, which can be rotated around arbitrary axes. In fact, arbitrary *transforms* seem to be possible.

Wouldn't this do more-or-less what I want? (If what I want is clear, which I'm not sure it is, even to myself.)

I'd have to provide the user some way to do this stuff and then transform every object in the scene, tho. Maybe that's what you meant.

@davidr it could be! Certainly give it a shot but the 3D capability isnโ€™t as robust as the 2D bits of the library which is why I roundly urge caution
@ogi I'll toot the results when I learn more.

@ogi I don't have all the #math ironed out yet, but making this work close to how I want is not only possible, it's pretty easy

GLViewWidget already allows moving the zoom/rotation center so really nothing NEEDS doing. I wanted to be able to click 3D objects and set them as the center, which required subclassing

There appears to be a bug (either in #python #opengl or in how #pyqtgraph uses it) that makes this a little tricky but not bad. Main thing is getting #geometry code right

Deets later

@davidr love to hear the 3D elements of the library getting some use. I've decided I'm tired of not knowing anything about #OpenGL so I've started going through the book on https://learnopengl.com Of the 3 places you named where the bug is, there's a 99.9% chance it's in #PyQtGraph's implementation of #OpenGL ... hope you get to the bottom of it!
Learn OpenGL, extensive tutorial resource for learning Modern OpenGL

Learn OpenGL . com provides good and clear modern 3.3+ OpenGL tutorials with clear examples. A great resource to learn modern OpenGL aimed at beginners.

@ogi The bug is some interaction with GLScatterPlotItem + {GLLinePlotItem, GLMeshItem} + GLViewWidget.itemsAt(). itemsAt refuses to return the scatter and also sometimes random items disappear from the graph. #opengl getting into a bad state during GL_SELECT?

I worked around it by checking all the points/vertexes manually which is why my geometry needs to be right (and isn't yet).

Or maybe the book will show me what's going on with the easier-to-use itemsAt...

@davidr weโ€™ve had some issues with itemsAt, if you search our issue tracker you can see we merged fixes somewhat recently (not sure if before or after our current release). Also in some cases you need to explicitly call something, canโ€™t remember the details โ€ฆtake a peek at the issue tracker

@ogi I'm using a clone of the repo, but it does help to know that this probably SHOULD work.

The scatter plots have a lot more going on than the line plots (like textures, pixel- vs coord-based sizes, etc) and I wasn't sure how that would play with the glRenderMode() scheme.

But really, that can't be it. A scatterplot by itself works just fine.

I was bruteforcing past that part from frustration but now tinkering with code seems easier than figuring out transform matrixes....

More later

@ogi I feel like an utter nitwit. I can't reproduce the bug. I also did a bunch of #3d #geometry to fix a discontinuity jump problem. In demoing this feature, I found that wasn't an issue either suddenly? WTF is going on. Maybe something to do with the laptop I was on? Unclear how.

So really...I've just made some callbacks for mouseReleaseEvent that select an object or a vertex on an object to be the new center. Woo.

Imma try to use this IRL for a while and see what happens.

@davidr you wouldn't be the first person that after pulling your hair out debugging something, you find yourself suddenly not being able to reproduce; no need to feel like a nitwit, it happens to all of us!