Got a little problem here guys. I see the edge of an invisible cube through the shadows of my model, any clues?
#include "engine.h"
int main(int argc, char** argv)
{
Initialize();
//Create a graphics context
Graphics(800,600);
//Create a world
if (!CreateWorld()) {
MessageBoxA(0,"Error","Failed to create world.",0);
goto exitapp;
}
CreateFramework();
//Create a camera
TEntity cam=CreateCamera();
CameraClearColor(cam,Vec4(0,0,1,1));
PositionEntity(cam,Vec3(0,2,-10));
//Create a light
TEntity Map = LoadScene("abstract::TestSystem.sbx");
TLight miau = CreatePointLight(100,0);
PositionEntity(miau,Vec3(0,0,0));
//Create a render buffer
TBuffer buffer=CreateBuffer(800,600,BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
int move=0;
int strafe=0;
TVec3 camrotation=Vec3(0);
float mx=0;
float my=0;
//Main loop
while(!AppTerminate()) {
//Camera look
if (MouseDown(1)){
HideMouse();
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;
RotateEntity(cam,camrotation);
}
else if (!MouseDown(1)){
ShowMouse();
}
RotateEntity(cam,camrotation);
//Camera movement
move=KeyDown(KEY_W)-KeyDown(KEY_S);
strafe= KeyDown(KEY_D)-KeyDown(KEY_A);
MoveEntity(cam,Vec3(strafe/10.0,0,move/10.0));
UpdateFramework();
RenderFramework();
//Swap the front and back buffer
Flip(0);
}
exitapp:
return Terminate();
}
here are the files you need: http://rapidshare.com/files/355513076/Test.rar.html
Thank you =)