i need to make a sin curve.
In LuaPlayer i use this code:
Code: Select all
while not Controls.read():start() do
	
   x = x + 1
   ang = ang + 1
   
   y = 100 + math.sin(math.rad(ang)) * 50
   screen:pixel(x,y,red)
   screen.waitVblankStart()
   screen.flip()
end
Now in C i use this:
Code: Select all
#define PI 3.1415926535897932
int de2rad(int degrees)
{
   return degrees * (PI/180);
}
int main()
{
        int x=0,y=0;
	int ang = 0;
	sceCtrlSetSamplingCycle(0);
	sceCtrlSetSamplingMode(1);
	InitGraphics();
	ScreenFrame(2,0);
	ClearScreen(black);
	WaitV();
	FlipScreenV();
	while (1) {
	     x = x + 1;
	     ang = ang + 1;
	     y = 100 + sin(de2rad(ang))*50;
	    
	     PutPixel(x,y,red);
	     WaitV();
	     FlipScreenV();
	}
	sceKernelExitGame();
	return 0;
}
Can u help me plz..
Regards,
ShUr1k3n