diff options
| author | jussi | 2022-03-06 15:01:59 +0200 |
|---|---|---|
| committer | jussi | 2022-03-06 15:01:59 +0200 |
| commit | debe4baa8c208458f847dd4c89c17f7cc39be559 (patch) | |
| tree | 9ecde213fee634ea075b2ef564a8226eda5545a8 /examples/waving_cubes/main.lua | |
| parent | 8035d31109964504d970ed302c7aa6ffa0a8f106 (diff) | |
| download | reilua-enhanced-debe4baa8c208458f847dd4c89c17f7cc39be559.tar.gz reilua-enhanced-debe4baa8c208458f847dd4c89c17f7cc39be559.tar.bz2 reilua-enhanced-debe4baa8c208458f847dd4c89c17f7cc39be559.zip | |
Bunnymark.
Diffstat (limited to 'examples/waving_cubes/main.lua')
| -rw-r--r-- | examples/waving_cubes/main.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/waving_cubes/main.lua b/examples/waving_cubes/main.lua index 8023f67..969dc3c 100644 --- a/examples/waving_cubes/main.lua +++ b/examples/waving_cubes/main.lua @@ -29,13 +29,15 @@ end function draw() local t = RL_GetTime() + local cos = math.cos + local sin = math.sin - local scale = (2.0 + math.sin(t)) * 0.7 + local scale = (2.0 + sin(t)) * 0.7 local camera_time = t * 0.3 local camera_pos = RL_GetCamera3DPosition( camera ) - camera_pos[1] = math.cos(camera_time) * 40.0 - camera_pos[3] = math.sin(camera_time) * 40.0 + camera_pos[1] = cos(camera_time) * 40.0 + camera_pos[3] = sin(camera_time) * 40.0 RL_SetCamera3DPosition( camera, camera_pos ) RL_ClearBackground( RAYWHITE ) @@ -47,7 +49,7 @@ function draw() for y = 0,num_blocks - 1 do for z = 0,num_blocks - 1 do local block_scale = (x + y + z) / 30 - local scatter = math.sin(block_scale * 20.0 + t * 4.0) + local scatter = sin(block_scale * 20.0 + t * 4.0) local cube_pos = { (x - num_blocks / 2) * (scale * 3.0) + scatter, |
