FOV question
Blitz3D Forums/Blitz3D Programming/FOV question
| ||
Has anyone made a function to set FOV, move the camera back, and set camerarange accordingly? Andy |
| ||
Function SetCameraFOV(Camera, FOV#) CameraZoom Camera, 1.0 / Tan(FOV#/2.0) End Function Move camera back? Set camerarange? Why? You don't need to do those when changing the fov. |
| ||
>Move camera back? Set camerarange? Why? You don't need to >do those when changing the fov. No, but I would like to be able to change FOV and then cancel out the zoom and make sure that I don't clutter my camera with triangles which were placed behind the camera... Example: A flightsim... Set FOV to 65 instead of the default makes the hangar placed infront of the aircraft bigger and means that part of the instrumentation is not visible by the camera. If I move the camera back, I leave the cockpit, and triangles from the rest of the aircraft clutter the view from the camera, so I adjust camerarange near so that the clutter is not drawn. I was just looking for a simple function to do this... I can't be the only one who has needed to do this!? Andy |
| ||
I don't understand what you want. If you change the camerazoom, then stuff that wasn't visible before is going to be visible. That's the point. There's no way for any code to automatically determine what parts of the scene you want to stay in the same locations at the same scale, nor is the camera "zoomed" in or "moved", and there is no place to which you can move it to correct for every possible thing which you'd want the player to be able to see. Do it manually. :-) |
| ||
>Do it manually. :-) I will! Andy |
| ||
I would also like to know the ratio to change fov yet keep the apparent scale the same. So I could 'perspectify' at will for freaky fx. |
| ||
If you want to do THAT, then you need to know the distance of the object in front of the center of the camera view which you want to maintain it's scale. But other than that I don't know how to dtermine how far forward you need to move the camera to maintain the scale of the object at that position. That badger animation website has an animation called Scampi which uses this effect. It's pretty cool. |