Search Unity

Pixels and coordinates for a surrounding sphere?

Discussion in 'VR' started by mettinger, Feb 24, 2020.

  1. mettinger

    mettinger

    Joined:
    Oct 29, 2015
    Posts:
    6
    In 2d, images are just arrays (grids) of numbers and displaying dynamic content is as simple as addressing single pixels and changing their illumination values. What is the analogous coordinate system for displaying 3d "images" surrounding the viewer in VR? In other words, I want to use a spherical "screen" in VR in which the viewer is situated at the center of the sphere. But "pixels" in a sphere become distorted near the poles using standard polar coordinates. In some mapping applications geodesic polyhedra are used where the sphere is tiled by triangles or hexagons and pentagons but these "coordinate systems" don't seem practical for animation and other dynamic applications.

    Is there a standard solution for this issue?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Your whole approach is impractical for animation and dynamic applications. The standard solution is to render triangles and quads in 3D space, rather than attempting to draw individual pixels.

    But if you must do something like this, your best bet is probably to surround the camera with a cube, and do your drawing on that. Yes, texels will still become a bit distorted (by perspective) near the corners of the cube, but it's not too bad.

    Keep in mind that a user in VR will perceive these surfaces as flat, unless you draw separate content for each eye.
     
  3. mettinger

    mettinger

    Joined:
    Oct 29, 2015
    Posts:
    6
    Drawing triangles in space (or two triangles to make a quad "pixel") is exactly what i want to do. I'm just not clear on what coordinate system to use. I can tile the enclosing sphere with triangles and change the colors of the triangles for my animation but I think I need some sort of "natural" tiling to make this process efficient.
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Ah. If it were me, I'd probably use a quad sphere (with square pixels).
     
  5. mettinger

    mettinger

    Joined:
    Oct 29, 2015
    Posts:
    6
    Thanks, that looks like a good solution! And, in retrospect, kinda obvious!