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

Is it possible to render fisheye or panorama image? #166

Open
StarRealMan opened this issue Sep 23, 2023 · 4 comments
Open

Is it possible to render fisheye or panorama image? #166

StarRealMan opened this issue Sep 23, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@StarRealMan
Copy link

StarRealMan commented Sep 23, 2023

Thank you for your great work!
I just want to know if it is possible to render fisheye or panorama image by setting the camera.
I tried to set the fov of the camera greater than 180 and this is the image I get:
02_random_scene

aspect ratio: 1
fov: 220

the code of the camera setting:

# Create a camera
dummy_camera = nvisii.camera.create(
    name = "camera",  
    aspect = float(opt.width)/float(opt.height)
)

dummy_camera.set_fov(220, float(opt.width)/float(opt.height))

camera = nvisii.entity.create(
    name = "camera",
    transform = nvisii.transform.create("camera"),
    camera = dummy_camera
)
camera.get_transform().look_at(at = (0,0,0), up = (1,0,0), eye = (0,0,5))
nvisii.set_camera_entity(camera)

It dose not seem to be OK.

Thank you if you can help!

@StarRealMan
Copy link
Author

I found that the fov is set using glm::perspective() which uses a pinhole camera model, so, I think it is not possible to achieve fisheye effect in this way.
I stil wonder if anyone can come up with ideas about fisheye image rendering using NVISII. Thanky you if you can reply.

@TontonTremblay TontonTremblay added the enhancement New feature or request label Sep 23, 2023
@TontonTremblay
Copy link
Collaborator

I remember @natevm and I talking about, and I recall that he said he would not be too hard to add, but at the moment I was not sure we would ever need it, the prime application we had in mind was computer vision to which you normally get rectified images and thus you would never get rounding artifacts.

I labeled it as a feature request.

@natevm
Copy link
Collaborator

natevm commented Sep 23, 2023

Yeah, in theory it would be possible to do. I vaguely remember a ray tracing gem on how to do a fish eye lens, but I’m not sure what changes would need to be made to the camera component to make that work.

I would also like to have an orthographic camera…

@StarRealMan
Copy link
Author

Thank you for your timely reply!
I'm now trying to generate fisheye images using cubemap rendered from NVISII and hope this will work. The only problem I need to worry is the mismatch of the pixels. I think greater resolution may solve it.

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

No branches or pull requests

3 participants