其他分享
首页 > 其他分享> > GAMES101 PA0

GAMES101 PA0

作者:互联网

配置环境

Ubuntu 18.04

Eigen3安装

sudo apt-get install libeigen3-dev

g++安装

sudo apt install g++

code

#include<cmath>
#include<eigen3/Eigen/Core>
#include<eigen3/Eigen/Dense>
#include<iostream>
using namespace std;
int main(){
    Eigen::Vector3f p(2.0f,1.0f,1.0f);
    Eigen::Matrix3f rotation;
    float angle = 45*M_PI/180;
    rotation << cos(angle), -sin(angle), 0 , sin(angle) , cos(angle) , 0 , 0 , 0 , 1;
    Eigen::Matrix3f translation;
    translation << 1,0,1,0,1,2,0,0,1;
    cout << translation*rotation*p;

    return 0;
}

标签:PA0,GAMES101,1.0,Eigen,sudo,apt,rotation,include
来源: https://blog.csdn.net/qq_36070935/article/details/120624332