57-模型读取Mesh类设计
Created|Updated|图形学工程&工业仿真1-图形学,从0构建一个opengl软光栅
|Post Views:
基础Mesh数据设计

Vertex用于表示一个顶点
Mesh用于表示多个点组成的曲面
Mesh当中存放着本Mesh绘制所需要的缓存对象
Assimp节点解析


Mesh最终的模型变换为:

Author: LYJ
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Related Articles
2025-10-03
01-Assimp库解析网格文件
将网格文件解析对应的网格数据结构struct Vector3f{ float x; float y; float z;};struct Vertex { Vector3f position; Vector3f normal;};struct TriangleFace { unsigned int indices[3]; float faceNormalX, faceNormalY, faceNormalZ;};struct MeshData { unsigned int vertexCount; unsigned int faceCount; Vertex* pVertices; TriangleFace* pFaces; float bboxMinX, bboxMinY, bboxMinZ; float bboxMaxX, bboxMaxY, bboxMaxZ;};#include <assimp/Importer....
2025-10-05
58-Mesh类代码实现
内容1.Mesh类与Model类2.示例 Mesh类与Model类model.h#pragma once#include "../global/base.h"#include "../math/math.h"#include "image.h"#include "../gpu/shader/lightShader.h"#include "assimp/Importer.hpp"#include "assimp/scene.h"#include "assimp/postprocess.h"struct Vertex { math::vec3f position; math::vec3f normal; math::vec2f texCoords;};class Model;class Mesh {public: Mesh( const std::vector<Vertex>& vertices...
2025-10-30
01-Assimp库解析网格文件
解析STL文件,获取Mesh结构数据struct Vector3f{ float x; float y; float z;};struct Vertex { Vector3f position; Vector3f normal;};struct TriangleFace { unsigned int indices[3]; float faceNormalX, faceNormalY, faceNormalZ;};struct MeshData { unsigned int vertexCount; unsigned int faceCount; Vertex* pVertices; TriangleFace* pFaces; float bboxMinX, bboxMinY, bboxMinZ; float bboxMaxX, bboxMaxY, bboxMaxZ;};#include <assimp/Importe...
Announcement
This is Seagull Blog
Contents
Post Series
