mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-29 19:10:26 +00:00
343e66b816
Models that contain UV co-ordinates are now supported, and will display with a texture wrapped around it, provided a `bmp` with the same name as the object is in the same directory as the 3D Model.
33 lines
562 B
C
33 lines
562 B
C
/*
|
|
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
|
|
* Copyright (c) 2021, Mathieu Gaillard <gaillard.mathieu.39@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGL/GL/gl.h>
|
|
|
|
// Point in 3D space
|
|
struct Vertex {
|
|
GLfloat x;
|
|
GLfloat y;
|
|
GLfloat z;
|
|
};
|
|
|
|
struct TexCoord {
|
|
GLfloat u;
|
|
GLfloat v;
|
|
};
|
|
|
|
// A triangle defines a single "face" of a mesh
|
|
struct Triangle {
|
|
GLuint a;
|
|
GLuint b;
|
|
GLuint c;
|
|
|
|
GLuint tex_coord_index0;
|
|
GLuint tex_coord_index1;
|
|
GLuint tex_coord_index2;
|
|
};
|