Skip to content

Instantly share code, notes, and snippets.

@djfm
Last active September 9, 2021 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djfm/c8f78e426c953c9e0d4c658eb79b63eb to your computer and use it in GitHub Desktop.
Save djfm/c8f78e426c953c9e0d4c658eb79b63eb to your computer and use it in GitHub Desktop.
#include "exampleScenes.h"
HelloWorldScene::HelloWorldScene():
Scene(
Screen(1000, 800),
Camera(-800, 100, 100, 80)
)
{
add(
new RectangleShape(
{
center + down * 100,
right * 600, front * 600
},
Color(120, 120, 120)
)
);
add(
new SphereShape(
{
center + up * 150 + left * 100,
50
},
Color(0, 0, 255)
)
);
Color cubeColors[6] = {
{255, 50, 50},
{50, 255, 50},
{50, 50, 255},
{255, 255, 50},
{50, 255, 255},
{50, 50, 255}
};
add(
new CubeShape(
center + up * 150 + right * 100,
right * 80, front * 80, up * 80,
cubeColors
)
);
add(
new SphericalLightShape(
{
center + up * 500,
5
},
Color(200, 200, 255)
)
);
camera
.translate(back * 200 + up * 500)
.rotate(-M_PI / 8, 0, 0)
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment