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

Submission: Assignment 6 #1

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

Conversation

abendo
Copy link

@abendo abendo commented Dec 6, 2020

No description provided.


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.

Here direction should be also updated

virtual void setTarget(const Vec3f& target) { m_target = target; }

Vec3f getTarget(void) const { return m_target; }

private:
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 setPosition() method, because it will change the direction of the 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();
Mat moonTransform = transform.rotate(Vec3f(0, 1, 0), 13.2f / 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.

How did you achieve these numbers?

// Mat rotationAroundTheSun = Mat::eye(4, 4, CV_32FC1);
Vec3f earthPivot = earth.getPivot();
std::cout << "earth pivot: " << earthPivot << std::endl;
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 was it calculated?

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