Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image stretched for BHV point light source #80

Open
Mathadon opened this issue Aug 27, 2023 · 2 comments
Open

image stretched for BHV point light source #80

Mathadon opened this issue Aug 27, 2023 · 2 comments

Comments

@Mathadon
Copy link

When zooming way out and rotating the camera in this example:
https://erichlof.github.io/THREE.js-PathTracing-Renderer/BVH_Point_Light_Source.html

The image looks like this:

image

The image is stretched out along just one axis. This seems wrong?

@erichlof
Copy link
Owner

Hello @Mathadon ,
This is actually correct behavior. Since our human eyes don't normally see with this extreme FOV, it makes it difficult to comprehend what going on with the abnormally stretched images. I was able to reproduce your view, but I turned my camera:

FOV_Stretching

My image shows a little better what's happening under the hood. At this extreme FOV (167 in the above image), the only time objects appear normal is if they are right in the center of the viewport. The further out objects are from the center, the more severe the stretching becomes. In this extreme case, you can actually have one object (the Stanford Bunny) with normal looking feet, but then as you get up into its ears that are farther from center, it becomes massively more stretched. This is theoretically what would happen to us if we were able to fly through a black hole: if we flew in head-first, then our upper bodies would be way more stretched than our feet (that hadn't caught up yet with our head's amount of gravity pull). The scientific name is 'spaghetti-fication' - ouch, LOL.

I think why it appears as one axis in your image is that you just happened to fly the camera up to the right spot and then rotated at just the right angle to catch the bunny's ears and light sphere where they are farther out from the center than the bunny's feet. If you look closely, the bunny's feet in your image actually don't look distorted at all, because they are nearer the center of the viewport. If you were to rotate your camera, you could probably make it look like it was stretched on any axis.

-Erich

@Mathadon
Copy link
Author

Mathadon commented Aug 28, 2023

@erichlof thanks for the quick and detailed answer! The main thing that I probably missed is that by scrolling my mouse, I thought I was moving the camera but in fact I was expanding the FOV (field of view), which I understand from that name to be the 'looking angle' of the camera. Then the result indeed makes perfect sense.

I dug around the documentation again and found that I have to use the "wasd" keyboard buttons to move the camera instead, then I indeed get the expected result.
image
I had tried the arrow keys but those don't control position either.

Perhaps to avoid having people make the same mistake as I did it would make sense to:

  1. change the default behaviour of the scroll button (or arrow keys)
  2. or, display on-screen camera instructions by default

Thanks for the great work (and permissive software license) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants