Genesis icon indicating copy to clipboard operation
Genesis copied to clipboard

[Feature]: Provide an interface to specify intrinsic and extrinsic parameters to create a camera

Open BugDigK opened this issue 5 months ago • 0 comments

What feature or enhancement are you proposing?

In practice, we can easily get the camera's intrinsic and extrinsic parameters, but "lookat" is a point, it is difficult to convert it. I would like to ask if there is a method in the v0.2.1 to convert camera intrinsic and extrinsic parameters to "lookat", or how to add a camera with specified intrinsic and extrinsic parameters. Thank you very much.

@gs.assert_unbuilt def add_camera( self, model="pinhole", res=(320, 320), pos=(0.5, 2.5, 3.5), lookat=(0.5, 0.5, 0.5), up=(0.0, 0.0, 1.0), fov=30, aperture=2.0, focus_dist=None, GUI=False, spp=256, denoise=True, ): """ Add a camera to the scene. The camera model can be either 'pinhole' or 'thinlens'. The 'pinhole' model is a simple camera model that captures light rays from a single point in space. The 'thinlens' model is a more complex camera model that simulates a lens with a finite aperture size, allowing for depth of field effects. When 'pinhole' is used, theapertureandfocal_len` parameters are ignored.

    Parameters
    ----------
    model : str
        Specifies the camera model. Options are 'pinhole' or 'thinlens'.
    res : tuple of int, shape (2,)
        The resolution of the camera, specified as a tuple (width, height).
    pos : tuple of float, shape (3,)
        The position of the camera in the scene, specified as (x, y, z).
    lookat : tuple of float, shape (3,)
        The point in the scene that the camera is looking at, specified as (x, y, z).
    up : tuple of float, shape (3,)
        The up vector of the camera, defining its orientation, specified as (x, y, z).
    fov : float
        The vertical field of view of the camera in degrees.
    aperture : float
        The aperture size of the camera, controlling depth of field.
    focus_dist : float | None
        The focus distance of the camera. If None, it will be auto-computed using `pos` and `lookat`.
    GUI : bool
        Whether to display the camera's rendered image in a separate GUI window.
    spp : int, optional
        Samples per pixel. Defaults to 256.
    denoise : bool
        Whether to denoise the camera's rendered image.

    Returns
    -------
    camera : genesis.Camera
        The created camera object.
    """

`

Motivation

As a [e.g. civil engineering researcher working on flood simulation] I want to [e.g. be able to simulate city-scale fluid / terrain simulations] Because [e.g. this enables the efficient design and validation of flood protection structures].

Potential Benefit

camera setting

What is the expected outcome of the implementation work?

  • [ ]

Additional information

No response

BugDigK avatar Aug 04 '25 07:08 BugDigK