초보질문이에요;;
한추렴
#include gamelib.h
int main(int argc, char** argv)
{
if(!Initialize())return 1;
TGame game;//TGame 을 이용해 game 생성
game.Initialize( 800, 600, 0);//해상도 설정(800x600),창모드(0),전체화면(1)
AFilter();
TFilter();
SetAppTitle(난천재다);//실행시 위에 뜰이름
// 메트리얼 불러오기
TMaterial tex=LoadMaterial(abstract::school.mat);//tex생성 tex에 school.mat이라는 텍스쳐 로드
// 카메라 위치 설정
TEntity cam=CreateCamera();//cam생성
PositionEntity(cam,Vec3(0,0,-4));//cam의 위치(x,y,z)
// mesh
TMesh mesh=CreateCube();//mesh생성
ScaleEntity(mesh,Vec3(5,0.08,5));//크기(x,y,z)
PositionEntity(mesh,Vec3(0,2,0));//위치(x,y,z)
PaintEntity(mesh,tex);//텍스쳐입히기mesh에 tex를 입힘
//벽생성
TMesh wall=CreateCube();//wall생성
ScaleEntity(wall,Vec3(5,5,0.08));//wall크기(x,y,z)
PositionEntity(wall,Vec3(0,0,0));//wall위치(x,y,z)
RotateEntity(wall,Vec3(0,0,90));//wall각도(x,y,z)
PaintEntity(wall,tex);//텍스쳐
//벽2생성
TMesh wall2=CreateCube();//위의내용과 똑같다 단지 wall2로 바뀔뿐
ScaleEntity(wall2,Vec3(5,0.08,5));
PositionEntity(wall2,Vec3(-2,0,0));
RotateEntity(wall2,Vec3(0,0,90));
PaintEntity(wall2,tex);
//벽3생성
TMesh wall3=CreateCube();//위의 내용과 똑같다 단지 wall3로 바뀔뿐
ScaleEntity(wall3,Vec3(5,0.08,5));
PositionEntity(wall3,Vec3(2,0,0));
RotateEntity(wall3,Vec3(0,0,90));
PaintEntity(wall3,tex);
// ground
TMesh ground=CreateCube();//ground생성
ScaleEntity(ground,Vec3(5,0.08,5));//ground크기(x,y,z)
PositionEntity(ground,Vec3(0,-2,0));//ground위치(x,y,z)
PaintEntity(ground,tex);//텍스쳐입히기
// 라이트
TLight light=CreateDirectionalLight();//light생성(directional라이트)
PositionEntity(light,Vec3(2,0,-3));//light위치
RotateEntity(light,Vec3(45,45,45));//light각도
SetShadowmapSize(light,2048);//그림자 선명도
//카메라 움직임1
TVec3 camrotation=Vec3(0,0,0);//camrotation구조체를 0,0,0으로 초기화
float mx=0;//
float my=0;//
float move=0;//
float strafe=0;//
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);//
// 게임 루프
while (!KeyHit(KEY_ESCAPE))
{
//카메라움직임2
mx=Curve(MouseX()-GraphicsWidth()/2,mx,6);
my=Curve(MouseY()-GraphicsHeight()/2,my,6);
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
camrotation.X=camrotation.X+my/15.0;
camrotation.Y=camrotation.Y-mx/15.0;
RotateEntity(cam,camrotation);
move=Curve(KeyDown(KEY_W)-KeyDown(KEY_S),move,20);
strafe=Curve(KeyDown(KEY_D)-KeyDown(KEY_A),strafe,20);
MoveEntity(cam,Vec3(strafe,0,move));
game.scene.Update();
game.scene.Render();
Flip(1); // Vsync 설정, 0=OFF, 1=ON
}
return Terminate();
}
대충 여기까지했는데
//카메라 움직임1여기서부터 주석 넣기가 막히네요 누가 좀도와주세요 흑흑
-
맥적다
민하수다님 여기도 계셨군,,,,초보질문이라니...