Jump to content

ghoflvhxj

Members
  • Posts

    76
  • Joined

  • Last visited

Posts posted by ghoflvhxj

  1. Hello.

    First, i want to say to you 'Sorry for not solving my self.'

     

    I just ran editor. As soon as ran, 'Windows exception' appeared.

    I searched about this error. And i can find some information.

    But, According to information, this error be formed by driver or Graphic(i'm HD5750) card.

    So i reinstalled my driver(Catalyst 11.12). But, error is not disappear..

    It will be like that why?

    I need your help.

  2. Just a moment ago, i tested.

    However, Unfortunately, the result failed...

    What is the flaw in my code?

    ..........
    TPivot pivot = CreatePivot(player);
    TPivot pivot2;
    TPivot pivot3= CreatePivot();
    TPick raycast;
    float camz;
    ..........
    while(!KeyHit(KEY_ESCAPE))
    {
                   .....
                   camz=MouseZ();
    	PositionEntity(cam,Vec3(0,2,camz));
    
                   pivot2 = CreatePivot(pivot);
    	PositionEntity(pivot2,Vec3(0.0f,0.0f,0.2f));
    	PointEntity(pivot2,cam);
    
    
    	if (EntityPick(&raycast,pivot2,10.0f,1)) 
    	{
    		PositionEntity(pivot3,Vec3(raycast.X,raycast.Y,raycast.Z));
    		PositionEntity(cam, Vec3(0,0,Min(camz, EntityDistance(player,pivot3)-1.0f)));
    	}
    	else 
    	{
    		PositionEntity(cam, Vec3(0,0,camz));
    	}
                   UpdateController(player,camrotation.Y,move,strafe,jump,40);
                   .....

  3. Hello guys.

    I'm just tried to make 3rd person view.

    and, i did it.

    But there is a serious flaw.

    It is the collisions of camera.;; I just want to make camera which have collisions.

    Can you help me please? ㅠㅠ

    Here is a picture and my code.

    #include "engine.h"
    int main(int argc, char** argv)
    {
    Initialize(1);
    
    //Create a graphics context
    Graphics(800,600);
    SetAppTitle("Project A");
    RegisterAbstractPath("C:\Program Files\Leadwerks Engine SDK");
    
    //Create a world
    if (!CreateWorld()) {
    MessageBoxA(0,"Error","Failed to create world.",0);
    goto exitapp;
    }
    
    CreateFramework();
    
    //옵션
    SetBloom(1);
    SetHDR(1);
    SetSSAO(1);
    SetGodRays(1);
    AFilter() ;
    TFilter() ;
    
    float move=0.0;
    float strafe=0.0;
    TVec3 camrotation=Vec3(0);
    TVec3 playerrotation=Vec3(0);
    float mx=0;
    float my=0;
    int sequence=3; //애니메이션 단계
    float framebegin,frameend,frame; //애니메이션 시작,끝 프레임
    
    //맵 로드
    TEntity map = LoadScene("abstract::test.sbx");
    
    //플레이어 생성, 충돌, 무게등등
    TController player=CreateController(1.8,0.3,0.5,45.45);
    PositionEntity(player,Vec3(-5,4,22));
    EntityType(player,1);
    SetBodyDamping(player,0.0);
    SetWorldGravity(Vec3(0,-20,0));
    SetBodyMass(player,1);
    
    //중심 생성
    TPivot pivot = CreatePivot(player);
    
    //카메라 생성
    TEntity cam= CreateCamera(pivot);
    EntityType(cam,1,true);
    CameraClearColor(cam,Vec4(255,255,255,255));
    PositionEntity(cam,Vec3(0,2,-3));
    
    //모델 로드,회전
    TMesh test = LoadMesh("abstract::crawler.gmf");
    RotateEntity(test,Vec3(0,180,0));
    
    //마우스 위치
    MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
    DebugPhysics(0);
    
    //Main loop
    while(!KeyHit(KEY_ESCAPE))
    {
    	//백터 값들.
    	TVec3 testrotation = EntityRotation(test);
    	TVec3 playerpos=EntityPosition(player);
    	playerrotation=EntityRotation(player);
    	//카메라 시선
    	mx=Curve(MouseX()-GraphicsWidth()/2,mx,6);
    	my=Curve(MouseY()-GraphicsHeight()/2,my,6);
    	MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);  
    	camrotation.X=camrotation.X+my/10.0;
    	camrotation.Y=camrotation.Y-mx/10.0;
    
    	//플레이어 움직임
    	move=(KeyDown(KEY_W)-KeyDown(KEY_S))*4.5;
    	strafe=(KeyDown(KEY_D)-KeyDown(KEY_A))*4.5;
    
    	//점프
    	float jump=0.0;
    	if (KeyHit(KEY_SPACE)) {
    		if (!ControllerAirborne(player)) {
    			jump=6.0;
    		}
    	}
    
    	//카메라 x축 제한
    	if(camrotation.X>23)
    		camrotation.X=23;
    	else if(camrotation.X<-32)
    		camrotation.X=-32;
    
    	//컨트롤러 업데이트
    	UpdateController(player,camrotation.Y,move,strafe,jump,40);
    
    	//모델 위치,회전
    	PositionEntity(test,Vec3(playerpos.X,playerpos.Y,playerpos.Z));
    	RotateEntity(test,Vec3(testrotation.X,testrotation.Y,testrotation.Z));
    
    	//모델 애니메이션
    	if(KeyDown(KEY_W) || KeyDown(KEY_D) || KeyDown(KEY_A) || KeyDown(KEY_S) || KeyDown(KEY_SPACE) || ControllerAirborne(player))
    	{
    		RotateEntity(test,Vec3(playerrotation.X,camrotation.Y+180,playerrotation.Z));
    	}
    	if(KeyDown(KEY_W)||KeyDown(KEY_S)||KeyDown(KEY_A)||KeyDown(KEY_D))
    	{
    		sequence=1;
    	}
    	else
    	{
    		sequence=3;
    	}
    
    	switch(sequence)
    	{
    		case 1:
    		 framebegin=131,frameend=171;
    		break;
    		case 2:
    		 framebegin=70,frameend=130;
    		break;
    		case 3:
    		 framebegin=0,frameend=68;
    		break;
    	}
    	frame=AppTime()/29.0;
    	frame=fmodf(frame,frameend-framebegin)+framebegin;
    	Animate(test,frame,1.0,0,true);
    
    	//와이어프레임
    	if(KeyDown(KEY_Q))
    	{
    		DebugPhysics(1);
    	}
    
    	UpdateFramework();
    
    	RotateEntity(pivot,camrotation,1);
    
    	RenderFramework();
    
    	SetBlend(BLEND_ALPHA);
    
    	SetBlend(BLEND_NONE);
    
    	Flip(0);
    }
    exitapp:
    return Terminate();
    }

    a.JPG?type=w3

  4. well just like with any engine there are bugs... which is why there are updates... just was curious, why you were picking a much earlier version to start out with... there are bugs in 2.5 as well, but at least you wont be haunted by ghostbugs of versions past... :)

    Thanks to your advice i changed my LE version.(2.5) :D

  5. Well there have been several bug fixes and improvements since 2.32... just curious why you are not using the latest version of 2.5 especially since it appears you are just starting to use LE. You could very well end up fighting a bug that has already been fixed.

    OMG...

    I didn't know about that.!

    I was walking into the forest of bugs!

    Thanks a million macklebee!

    Then, LE2.5 the best version?

×
×
  • Create New...