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

Camera looking strange when moving drastically #238

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
6 changes: 6 additions & 0 deletions kubric/core/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def __init__(self, position=(0., 0., 0.), quaternion=None,
up="Y", front="-Z", look_at=None, euler=None, **kwargs):
if look_at is not None:
assert quaternion is None and euler is None
self.lookat = look_at
quaternion = look_at_quat(position, look_at, up, front)
elif euler is not None:
assert look_at is None and quaternion is None
Expand All @@ -137,6 +138,11 @@ def __init__(self, position=(0., 0., 0.), quaternion=None,
def look_at(self, target):
self.quaternion = look_at_quat(self.position, target, self.up, self.front)

def set_position(self, value):
self.position = value
self.look_at(self.lookat)
return None

@property
def rotation_matrix(self):
""" Returns the rotation matrix corresponding to self.quaternion."""
Expand Down
Loading