Games101Homework【0】Build an environment

2024-03-22 22:36

本文主要是介绍Games101Homework【0】Build an environment,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Preface:

I just want 放洋屁,and then learn graphics. So,This essay is born.

I will show you the whole process of my study,Including the bugs I created.

Cool lets begin!

Download:

BaiduNetworkDisk:from bilibili comment

https://pan.baidu.com/s/1ttFTBF_Bk7eN6X3DE4ca0Q?pwd=void

Open pdf files and you will see the explanation in Chinese.

Lets open homework 0!

DO:

I'll spare you the procedure for configuring the virtual machine.

then here are some bugs and problems I've had:

Cannot drag files:

choose a disk file and find:VBoxGuestAdditions.iso

choose drag bothway:

 

then see this:

VirtualBox虚拟机与主机之间复制粘贴设置以及文件拖拽_vm virtualbox怎么互拖文件-CSDN博客

but paste board sharing problem is not solved!!

Distinguish between points and vectors in 3D:

Scale and Translation:

Rotation:

You just need to apply the formula!

Code:

#include<cmath>
#include<eigen3/Eigen/Core>
#include<eigen3/Eigen/Dense>
#include<iostream>
//acos(-1)==pi#define PI std::acos(-1) 
int main(){// Basic Example of cppstd::cout << "Example of cpp \n";float a = 1.0, b = 2.0;std::cout << a << std::endl;std::cout << a/b << std::endl;std::cout << std::sqrt(b) << std::endl;std::cout << std::acos(-1) << std::endl;std::cout << std::sin(30.0/180.0*acos(-1)) << std::endl;// Example of vectorstd::cout << "Example of vector \n";// vector definitionEigen::Vector3f v(1.0f,2.0f,3.0f);Eigen::Vector3f w(1.0f,0.0f,4.0f);// vector outputstd::cout << "Example of output \n";std::cout << v << std::endl;// vector addstd::cout << "Example of add \n";std::cout << v + w << std::endl;// vector scalar multiplystd::cout << "Example of scalar multiply \n";std::cout << v * 3.0f << std::endl;std::cout << 2.0f * v << std::endl;// Example of matrixstd::cout << "Example of matrix \n";// matrix definitionEigen::Matrix3f i,j;i << 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0;j << 2.0, 3.0, 1.0, 4.0, 6.0, 5.0, 9.0, 7.0, 8.0;// matrix outputstd::cout << "Example of output \n";std::cout << i << std::endl;// matrix add i + j// matrix scalar multiply i * 2.0// matrix multiply i * j// matrix multiply vector i * vEigen::Vector3f p(2.0,1.0,1.0);Eigen::Matrix3f T,R;//all angles in the future will be radian systemfloat angle=45.0/180.0*PI;//write rotation around  z axis R<<std::cos(angle),-std::sin(angle),0.0,std::sin(angle),std::cos(angle),0.0,0.0,           0.0,             1.0;//translate:T<<1.0,0.0,1.0,0.0,1.0,2.0,0.0,0.0,1.0;std::cout<<"outputTRP"<<std::endl;//multiply from right to leftstd::cout<<T*R*p<<std::endl;return 0;
}

Result:

这篇关于Games101Homework【0】Build an environment的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/836342

相关文章

Maven pom.xml文件中build,plugin标签的使用小结

《Mavenpom.xml文件中build,plugin标签的使用小结》本文主要介绍了Mavenpom.xml文件中build,plugin标签的使用小结,文中通过示例代码介绍的非常详细,对大家的学... 目录<build> 标签Plugins插件<build> 标签<build> 标签是 pom.XML

MCU7.keil中build产生的hex文件解读

1.hex文件大致解读 闲来无事,查看了MCU6.用keil新建项目的hex文件 用FlexHex打开 给我的第一印象是:经过软件的解释之后,发现这些数据排列地十分整齐 :02000F0080FE71:03000000020003F8:0C000300787FE4F6D8FD75810702000F3D:00000001FF 把解释后的数据当作十六进制来观察 1.每一行数据

Android Environment 获取的路径问题

1. 以获取 /System 路径为例 /*** Return root of the "system" partition holding the core Android OS.* Always present and mounted read-only.*/public static @NonNull File getRootDirectory() {return DIR_ANDR

flutter开发实战-flutter build web微信无法识别二维码及小程序码问题

flutter开发实战-flutter build web微信无法识别二维码及小程序码问题 GitHub Pages是一个直接从GitHub存储库托管的静态站点服务,‌它允许用户通过简单的配置,‌将个人的代码项目转化为一个可以在线访问的网站。‌这里使用flutter build web来构建web发布到GitHub Pages。 最近通过flutter build web,通过发布到GitHu

pip install pyaudio sounddevice error: externally-managed-environment

shgbitai@shgbitai-C9X299-PGF:~/pythonworkspace/ai-accompany$ pip install pyaudio sounddeviceerror: externally-managed-environment× This environment is externally managed╰─> To install Python package

Creating OpenAI Gym Environment from Map Data

题意:从地图数据创建 OpenAI Gym 环境 问题背景: I am just starting out with reinforcement learning and trying to create a custom environment with OpenAI gym. However, I am stumped with trying to create an enviro

兔子-build.gradle中代码的含义

//声明构建的项目类型,这里当然是android了apply plugin: 'com.android.application'//设置编译android项目的参数android {// SDK的版本号,也就是API Level,例如API-19、API-20、API-21等等。compileSdkVersion 23//构建工具的版本,其中包括了打包工具aapt、dx等等。// 这个工具的目

Navicat Premium上出现Cannot create oci environment错误的解决办法

因为要连接运程的Orcale数据库,由于一些原因连不上,于是我把顶栏里的工具->选项->Oic(最最下面的一个)的oci.dll给替换了,然后就一直出现Cannot create oci environment这个错误 这是由于替换的oci.dll的版本不对,于是替换了各种版本有时候也会出现这个错误 最后就是因为版本不对,先看好安装的版本然后下载一个相对应的 下载地址:http://ww

The `XXXUITests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build......

出现的警告: [!] The `ColorInHeartUITests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-ColorInHeart-ColorInHeartUITests/Po

6-通过Java代码build cube

转:http://www.cnblogs.com/hark0623/p/5580632.html 通常是用于增量 代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3