ndavd / ncube

Generalized Hypercube Visualizer
https://ncube.ndavd.com
MIT License
117 stars 7 forks source link

[Feature] Use color to represent one dimension. #14

Open JeffreyBenjaminBrown opened 10 months ago

JeffreyBenjaminBrown commented 10 months ago

I haven't thought much about 5d, but a 4d object can be represented in 3d by simply adding color. If there were a compass on-screen to orient the reader (as suggested in another feature request), it could introduce another collection of sliders that reflects/controls the high-dimensional vector that maps to the "red-blue axis".

There is of course the problem that multiple points in the high-dimensional object might map to the same pixel, but with different colors. I guess the one "in front" should then be the one to determine the color of the pixel, if that's a well-defined concept.

ndavd commented 10 months ago

So basically coloring depending on the position that edge/face has in a certain dimension?

JeffreyBenjaminBrown commented 10 months ago

I'm imagining each pixel having a potentially different color, even within the same face or edge. Currently, I believe, each axis of the projected-into space corresponds to a vector in the projected-from space. (Or maybe not? Are these projections parallel or something else? If they're not parallel then there's no such correspondence.) By using color we could simply represent another dimension of the projected-from space in the projected-to space. Like all the blue points are "jhyperabove" the projected-into space, and all the red points are "hyperbelow" it -- except rather than a strict binary classification there would be a smooth gradient from very red to very blue.

If you're using non-parallel projections, I think this can still be done, but it's a little more involved. If you're rendering from N to K (N > K) dimensions and want to add color, you would render first to K+1 dimensions, and then call one of those dimensions color, and parallel-project down from K+1 to K, but coloring all the points in the K-dimensional space according to their coordinate in the remaining coordinate.

ndavd commented 10 months ago

I think to achieve that I'd need to write custom shaders for the vertices. Will take a while as I don't have much experience with that.

JeffreyBenjaminBrown commented 10 months ago

I sure as hell couldn't do it. Thanks for actually reading all these ideas! What you've made is already beautiful.

ndavd commented 10 months ago

Thanks again for the support and the great ideas! It really motivates me to take ncube to the next level! I want this to become a place to experiment, discuss and learn about hyperdimensional geometry.