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

Assignment #6 #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

SHOROUKAWWAD
Copy link

No description provided.

Copy link
Contributor

@ereator ereator left a 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; }
Copy link
Contributor

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; }
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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?

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

Successfully merging this pull request may close these issues.

2 participants