- Home /
[maths q] How to match planes pos in worldspace to skybox on a camera?
I have a skybox camera (using a cubemap material) and a second camera. Both cameras are always in the same position and rotation. I want some quads drawn by the second camera to look as if they are part of the skybox camera. That is, when the cameras rotate, the quads drawn by cam2 should move/rotate as if they were in the cubemap.
My first thought was that I could place the quads at a distance from cam2 equal to the far plane of cam1 (the skybox cam). But it seems the skybox/cubemap is not drawn based on far planes, as the quads and skybox do not sync up.
My second thought was a sphere with the cubemap material (instead of using skybox on the camera). This keeps the quads in sync as you would expect, but the problem is the uv mapping on a sphere has seams, which are not hidden by the cubemap material (even though I would have expected them to be, because the shader uses the position of vertices for mapping, not the uv coords).
Visually, this will be a starfield background, with decorative items like nebulae on the quads. I want to be able to change the quads at will, but as they are meant to be very distant, they need to match the starfield(skybox) rotation reasonably accurately (a little bit of drift would be acceptable).
So now I'm trying to figure out how to calculate the position of the quads mathematically to match the skybox, but I'm completely lost. I can't find any resources explaining how the camera skyboxes are calculated.
I would be grateful if someone could point me in the right direction or knows something to get me started on this problem, because I am unable to get my head around the maths without the right info.
Your answer
Follow this Question
Related Questions
new project aren't set up right 1 Answer
How to design Skybox design?? 1 Answer
No Mesh Render, No GameObject after building game. 1 Answer