Positioning & Rotation bugfixes.
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m51s
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m51s
Make it such that a sprites "origin" doesn't effect the position. It is only the point at which transformations are done about.
This commit is contained in:
7
main.cpp
7
main.cpp
@@ -112,7 +112,7 @@ public:
|
||||
glDepthFunc(GL_LESS);
|
||||
glDepthMask(GL_TRUE);
|
||||
image = new Texture("assets/sprites/Re3D.png", TextureFilteringMode::BILINEAR);
|
||||
j2d_render_target = new RenderTarget(1280, {0,0,0,0});
|
||||
j2d_render_target = new RenderTarget({500, 500}, {255,0,0,0});
|
||||
}
|
||||
|
||||
Vector3 textAngle = {0,0,0};
|
||||
@@ -147,7 +147,8 @@ public:
|
||||
glLoadIdentity();
|
||||
|
||||
camera->render();
|
||||
///All 3D elements of the scene and JGL elements *must* be rendered before the 2d stuff.
|
||||
// All 3D elements of the scene and JGL elements *must* be rendered before the 2D stuff
|
||||
/* if rendering to screen space directly. */
|
||||
|
||||
J3D::Begin();
|
||||
J3D::DrawLine(Colors::Red, {-0.33,-0.125,1}, {-1,-0.125,1});
|
||||
@@ -194,7 +195,7 @@ public:
|
||||
|
||||
//Draw the Render Target that we just drew all that stuff onto.
|
||||
J2D::Begin();
|
||||
J2D::DrawRenderTargetAsSprite(*j2d_render_target, {0, 0});
|
||||
J2D::DrawRenderTargetAsSprite(*j2d_render_target, {0, 0}, sprite_radians * 0.25, {0.5, 0.5}, {1,1}, Colors::White);
|
||||
J2D::End();
|
||||
|
||||
if (framerate_measurement) {
|
||||
|
Reference in New Issue
Block a user