-
Notifications
You must be signed in to change notification settings - Fork 10
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
Assignment #6 #3
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Animation do not work at all
|
||
// virtual void setPosition(const Vec3f& pos) override { pos = m_target; } | ||
|
||
virtual void setTarget(const Vec3f& target) { m_target = target; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to update direction also here
|
||
virtual void setTarget(const Vec3f& target) { m_target = target; } | ||
|
||
Vec3f getTarget(void) const { return m_target; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to override method setPosition() because it affects direction of the target camera
Mat moonTransform = Mat::eye(4, 4, CV_32FC1); | ||
|
||
CTransform T; | ||
Mat earthTransform = transform.rotate(Vec3f(0.399f, 0.917, 0), 360.0f / nFrames).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From where did you take these numbers? What does they mean?
@@ -127,8 +126,10 @@ Mat RenderFrame(void) | |||
|
|||
// --- PUT YOUR CODE HERE --- | |||
// Apply transforms here | |||
Mat rotationAroundTheSun = Mat::eye(4, 4, CV_32FC1); | |||
Vec3f earthPivot = earth.getPivot(); | |||
Mat rotationAroundTheSun = transform.translate(earthPivot).rotate(Vec3f(0, 1, 0), 1.0f / nFrames).translate(-earthPivot).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does 1.0f / nFrames mean? How did you achieve this formula?
No description provided.