360 spherical camera
360 spherical camera
Is there a way to simply make a camera take in a 360 spherical view of it's surroundings?
-
- Posts: 98
- Joined: Mon Dec 13, 2004 11:47 am
- Location: Japan
Basically not possible. Even a 180 degree view would be distorted.
Both Direct3D and OpenGL (and probably the software renderer) use linear transformations to map 3D coordinates to screen coordinates.
Correct mapping would use the arctangent of the x and z coordinates. The arctangent is roughly linear only when the angle is small enough (less than approx. 65 degrees IIRC).
Also, since triangles are rendered using linear interpolation between screenmapped vertices, anything beyond a 180 degree view is impossible (without clipping, stuff behind the viewer would be rendered in front of the viewer). This linear interpolation also means that if the FIV is too wide, there's distortion near the edges.
In principle it should be possible to render multiple viewports next to each other, each with a different quadrant of the 360 degree view - and by doing so avoiding the distortion and clipping issues, but you might get some jagged edges at the viewport borders, and I'm not sure Irrlicht even gives you the option of rendering into a viewport.
In any case, it requires rendering multiple times.
Both Direct3D and OpenGL (and probably the software renderer) use linear transformations to map 3D coordinates to screen coordinates.
Correct mapping would use the arctangent of the x and z coordinates. The arctangent is roughly linear only when the angle is small enough (less than approx. 65 degrees IIRC).
Also, since triangles are rendered using linear interpolation between screenmapped vertices, anything beyond a 180 degree view is impossible (without clipping, stuff behind the viewer would be rendered in front of the viewer). This linear interpolation also means that if the FIV is too wide, there's distortion near the edges.
In principle it should be possible to render multiple viewports next to each other, each with a different quadrant of the 360 degree view - and by doing so avoiding the distortion and clipping issues, but you might get some jagged edges at the viewport borders, and I'm not sure Irrlicht even gives you the option of rendering into a viewport.
In any case, it requires rendering multiple times.
Just like Testur, I don't see that as an option.
It describes how to generate the necessary skybox textures to give the impression of a sky-"sphere" instead of a textured cube.
Presumably Testur's goal was to have dynamic 360 degree views, not prerendered skybox textures. Other than rendering in slices there is no fast option for doing that.
It describes how to generate the necessary skybox textures to give the impression of a sky-"sphere" instead of a textured cube.
Presumably Testur's goal was to have dynamic 360 degree views, not prerendered skybox textures. Other than rendering in slices there is no fast option for doing that.
Actually, my goal was to use the 360 camera as the base to create on-the-fly reflection maps via Render-To-Texture. Thouht it would have been nice to see your character being reflected in objects in the scene.T101 wrote:Presumably Testur's goal was to have dynamic 360 degree views, not prerendered skybox textures. Other than rendering in slices there is no fast option for doing that.
Now if there would be another way to acomplish this I would sure like to know.
I think the standard way to do reflection maps is to render to a cubemap.
You still have to render 6 times to render that cubemap, but it's doable, and you probably don't need to render with as much detail as you need for the final scene. After all, the reflection map will be distorted by the reflective objects.
You still have to render 6 times to render that cubemap, but it's doable, and you probably don't need to render with as much detail as you need for the final scene. After all, the reflection map will be distorted by the reflective objects.