<commit_before>#include <QtGui>
#include <QtOpenGL>

#include <math.h>

#include "GLWidget.h"

#ifndef GL_MULTISAMPLE
#define GL_MULTISAMPLE  0x809D
#endif

GLWidget::GLWidget(QWidget* const parent)
	: QGLWidget(QGLFormat(QGL::SampleBuffers), parent),
	xRot(0),
	yRot(0),
	zRot(0)
{
}

void GLWidget::initializeGL()
{
	qglClearColor(Qt::black);
	glEnable(GL_MULTISAMPLE);
}

void GLWidget::paintGL()
{
	glClear(GL_COLOR_BUFFER_BIT);
	glLoadIdentity();
	applyRotation();
	this->render();
}

void GLWidget::applyRotation() const
{
	static const float ROTATION_DENOM = 1 / (float)GLWidget::ROTATION_SCALE;
	glRotatef((float)(xRot) * ROTATION_DENOM, 1.0, 0.0, 0.0);
	glRotatef((float)(yRot) * ROTATION_DENOM, 0.0, 1.0, 0.0);
	glRotatef((float)(zRot) * ROTATION_DENOM, 0.0, 0.0, 1.0);
}

void GLWidget::resizeGL(int width, int height)
{
	glViewport(0, 0, width, height);

	const float aspectRatio = (float) height / (float) width;
	const float range = 100.0;

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	if (width <= height) {
		glOrtho(-range, range, -range * aspectRatio, range * aspectRatio, 2 * range, 2 * -range);
	} else {
		glOrtho(-range / aspectRatio, range / aspectRatio, -range, range, 2 * range, 2 * -range);
	}
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
}
<commit_msg>Flipped the projection to be looking towards the positive z-axis<commit_after>#include <QtGui>
#include <QtOpenGL>

#include <math.h>

#include "GLWidget.h"

#ifndef GL_MULTISAMPLE
#define GL_MULTISAMPLE  0x809D
#endif

GLWidget::GLWidget(QWidget* const parent)
	: QGLWidget(QGLFormat(QGL::SampleBuffers), parent),
	xRot(0),
	yRot(0),
	zRot(0)
{
}

void GLWidget::initializeGL()
{
	qglClearColor(Qt::black);
	glEnable(GL_MULTISAMPLE);
}

void GLWidget::paintGL()
{
	glClear(GL_COLOR_BUFFER_BIT);
	glLoadIdentity();
	applyRotation();
	this->render();
}

void GLWidget::applyRotation() const
{
	static const float ROTATION_DENOM = 1 / (float)GLWidget::ROTATION_SCALE;
	glRotatef((float)(xRot) * ROTATION_DENOM, 1.0, 0.0, 0.0);
	glRotatef((float)(yRot) * ROTATION_DENOM, 0.0, 1.0, 0.0);
	glRotatef((float)(zRot) * ROTATION_DENOM, 0.0, 0.0, 1.0);
}

void GLWidget::resizeGL(int width, int height)
{
	glViewport(0, 0, width, height);

	const float aspectRatio = (float) height / (float) width;
	const float range = 100.0;

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	if (width <= height) {
		glOrtho(
			-range,
			range,
			-range * aspectRatio,
			range * aspectRatio,
			2 * -range,
			2 * range);
	} else {
		glOrtho(
			-range / aspectRatio,
			range / aspectRatio, -range,
			range,
			2 * -range,
			2 * range);
	}
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
}

{'fraction_non_alphanumeric': 0.15526315789473685, 'fraction_numerical': 0.02706766917293233, 'mean_word_length': 5.020361990950226, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7612392', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1071, 'n_words': 219}