mostly implemented skybox and fixed box verts

This commit is contained in:
devZoGok
2021-10-18 19:04:20 +03:00
parent fd09cbf762
commit 03f65e62f5
22 changed files with 227 additions and 106 deletions
+2 -2
View File
@@ -49,11 +49,11 @@ namespace vb01{
Camera *cam=root->getCamera();
float fov=cam->getFov(),width=root->getWidth(),height=root->getHeight();
float nearPlane=cam->getNearPlane(),farPlane=cam->getFarPlane();
Vector3 pos=node->getPosition();
Vector3 pos=(node?node->getPosition():Vector3::VEC_ZERO);
Vector3 dir=cam->getDirection(),up=cam->getUp(),camPos=cam->getPosition();
mat4 model=translate(mat4(1.),vec3(pos.x,pos.y,pos.z));
model=rotate(model,13.f,vec3(0,1,0));
model=rotate(model,radians(0.f),vec3(0,1,0));
mat4 view=lookAt(vec3(camPos.x,camPos.y,camPos.z),vec3(camPos.x+dir.x,camPos.y+dir.y,camPos.z+dir.z),vec3(up.x,up.y,up.z));
mat4 proj=perspective(radians(fov),width/height,nearPlane,farPlane);
//proj=ortho(0.f,800.f,0.f,-600.f,nearPlane,farPlane);