mirror of
https://github.com/Linloir/SceneEditor.git
synced 2025-12-17 15:38:11 +08:00
将项目中的绝对地址全部改为相对地址了
This commit is contained in:
parent
ff8d48cae4
commit
fe28e220ea
@ -85,14 +85,14 @@ void SceneViewer::initializeGL() {
|
||||
fragmentShader_ter.dispose();
|
||||
|
||||
|
||||
Model* backpackModel = new Model("D:\\ProgrammingFile\\SceneEditor\\Models\\backpack\\backpack.obj");
|
||||
Model* backpackModel = new Model("../Models/backpack/backpack.obj");
|
||||
Logger::info("Model loaded");
|
||||
Renderable backpack(backpackModel);
|
||||
_objects.push_back(backpack);
|
||||
|
||||
sky = new skybox("D:/ProgrammingFile/SceneEditor/skybox");
|
||||
sky = new skybox("../skybox");
|
||||
|
||||
ter = new Terrain();
|
||||
ter = new Terrain("../terrain");
|
||||
|
||||
_camera.setPosition(glm::vec3(0.0f, 0.0f, 5.0f));
|
||||
}
|
||||
|
||||
@ -4,12 +4,12 @@
|
||||
#include <STBImage/stb_image.h>
|
||||
#include <vector>
|
||||
|
||||
Terrain::Terrain(int rows, int cols):row_num(rows),col_num(cols) {
|
||||
Terrain::Terrain(std::string path){
|
||||
Vertex.clear();
|
||||
Indicess.clear();
|
||||
int imgW, imgH, imgChannel;
|
||||
|
||||
unsigned char* data = stbi_load("D:/ProgrammingFile/SceneEditor/terrain/heightmap.jpg", &imgW, &imgH, &imgChannel, 1);
|
||||
unsigned char* data = stbi_load((path + "/heightmap.jpg").c_str(), &imgW, &imgH, &imgChannel, 1);
|
||||
|
||||
|
||||
int index1 = 0, index = 0;
|
||||
@ -83,7 +83,7 @@ Terrain::Terrain(int rows, int cols):row_num(rows),col_num(cols) {
|
||||
OPENGL_EXTRA_FUNCTIONS->glBindVertexArray(0);
|
||||
|
||||
//textureID = loadTexture2(texName, GL_REPEAT, GL_REPEAT, GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR);
|
||||
tex = loadTexture("D:/ProgrammingFile/SceneEditor/terrain/rock.jpg");
|
||||
tex = loadTexture(path + "/texture.jpg");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -10,10 +10,9 @@ private:
|
||||
std::vector<float> Vertex;
|
||||
std::vector<unsigned int> Indicess;
|
||||
unsigned int VAO, VBO, EBO;
|
||||
int row_num, col_num;
|
||||
public:
|
||||
unsigned int dep, tex;
|
||||
Terrain(int rows = 200, int cols = 200);
|
||||
unsigned int tex;
|
||||
Terrain(std::string path);
|
||||
void render();
|
||||
unsigned int loadTexture(std::string path);
|
||||
};
|
||||
|
Before Width: | Height: | Size: 271 KiB After Width: | Height: | Size: 271 KiB |
Loading…
x
Reference in New Issue
Block a user