tmarrinan / cube2equirect Goto Github PK
View Code? Open in Web Editor NEWConverts Cubemap image sets to an Equirectangular projection image
License: GNU General Public License v3.0
Converts Cubemap image sets to an Equirectangular projection image
License: GNU General Public License v3.0
@tmarrinan
Thanks for your code.
Does this project run on Mac OS?
I noticed that the image result has a lot of jagged lines (aliasing).
Have you considered implementing a resampling function? (bicubic, lanczos etc.)
When I make the code on the terminal, it gives me this error:
fatal error: GL3/gl3.h: No such file or directory
So I changed on the cube2equirect.h the #include <GL3/gl3.h>
to #include <GL/gl.h>
It solved the error but when I make it again this appened
make g++ -c -g -o objs/cube2equirect.o src/cube2equirect.cpp
sdl2-config --cflags -I/usr/local/include -I/usr/X11R6/include src/cube2equirect.cpp: In member function ‘void cube2equirect::render()’: src/cube2equirect.cpp:36:5: error: ‘glBindFramebuffer’ was not declared in this scope; did you mean ‘equirectFramebuffer’? 36 | glBindFramebuffer(GL_FRAMEBUFFER, equirectFramebuffer); | ^~~~~~~~~~~~~~~~~ | equirectFramebuffer src/cube2equirect.cpp:44:5: error: ‘glUniform1i’ was not declared in this scope 44 | glUniform1i(cubeLeftUniform, 0); | ^~~~~~~~~~~ src/cube2equirect.cpp:71:5: error: ‘glBindVertexArray’ was not declared in this scope 71 | glBindVertexArray(vertexArrayObject); | ^~~~~~~~~~~~~~~~~ src/cube2equirect.cpp: In member function ‘void cube2equirect::initBuffers()’: src/cube2equirect.cpp:104:5: error: ‘glGenVertexArrays’ was not declared in this scope 104 | glGenVertexArrays(1, &vertexArrayObject); | ^~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:105:5: error: ‘glBindVertexArray’ was not declared in this scope 105 | glBindVertexArray(vertexArrayObject); | ^~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:108:5: error: ‘glGenBuffers’ was not declared in this scope; did you mean ‘glReadBuffer’? 108 | glGenBuffers(1, &vertexPositionBuffer); | ^~~~~~~~~~~~ | glReadBuffer src/cube2equirect.cpp:109:5: error: ‘glBindBuffer’ was not declared in this scope; did you mean ‘glReadBuffer’? 109 | glBindBuffer(GL_ARRAY_BUFFER, vertexPositionBuffer); | ^~~~~~~~~~~~ | glReadBuffer src/cube2equirect.cpp:116:5: error: ‘glBufferData’ was not declared in this scope 116 | glBufferData(GL_ARRAY_BUFFER, 12 * sizeof(GLfloat), vertices, GL_STATIC_DRAW); | ^~~~~~~~~~~~ src/cube2equirect.cpp:117:5: error: ‘glEnableVertexAttribArray’ was not declared in this scope 117 | glEnableVertexAttribArray(vertexPositionAttribute); | ^~~~~~~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:118:5: error: ‘glVertexAttribPointer’ was not declared in this scope; did you mean ‘glVertexPointer’? 118 | glVertexAttribPointer(vertexPositionAttribute, 3, GL_FLOAT, false, 0, 0); | ^~~~~~~~~~~~~~~~~~~~~ | glVertexPointer src/cube2equirect.cpp: In member function ‘void cube2equirect::initRenderToTexture()’: src/cube2equirect.cpp:146:5: error: ‘glGenFramebuffers’ was not declared in this scope 146 | glGenFramebuffers(1, &equirectFramebuffer); | ^~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:147:5: error: ‘glBindFramebuffer’ was not declared in this scope; did you mean ‘equirectFramebuffer’? 147 | glBindFramebuffer(GL_FRAMEBUFFER, equirectFramebuffer); | ^~~~~~~~~~~~~~~~~ | equirectFramebuffer src/cube2equirect.cpp:158:5: error: ‘glFramebufferTexture2D’ was not declared in this scope 158 | glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, equirectTexture, 0); | ^~~~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp: In member function ‘GLint cube2equirect::compileShader(std::string, GLint)’: src/cube2equirect.cpp:211:20: error: ‘glCreateShader’ was not declared in this scope 211 | GLint shader = glCreateShader(type); | ^~~~~~~~~~~~~~ src/cube2equirect.cpp:215:5: error: ‘glShaderSource’ was not declared in this scope 215 | glShaderSource(shader, 1, &srcBytes, &srcLength); | ^~~~~~~~~~~~~~ src/cube2equirect.cpp:216:5: error: ‘glCompileShader’ was not declared in this scope; did you mean ‘compileShader’? 216 | glCompileShader(shader); | ^~~~~~~~~~~~~~~ | compileShader src/cube2equirect.cpp:217:5: error: ‘glGetShaderiv’ was not declared in this scope 217 | glGetShaderiv(shader, GL_COMPILE_STATUS, &status); | ^~~~~~~~~~~~~ src/cube2equirect.cpp:224:9: error: ‘glGetShaderInfoLog’ was not declared in this scope 224 | glGetShaderInfoLog(shader, length, NULL, info); | ^~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp: In member function ‘void cube2equirect::createShaderProgram(std::string, GLint, GLint)’: src/cube2equirect.cpp:237:21: error: ‘glCreateProgram’ was not declared in this scope 237 | shaderProgram = glCreateProgram(); | ^~~~~~~~~~~~~~~ src/cube2equirect.cpp:238:5: error: ‘glAttachShader’ was not declared in this scope 238 | glAttachShader(shaderProgram, vertexShader); | ^~~~~~~~~~~~~~ src/cube2equirect.cpp:241:5: error: ‘glBindAttribLocation’ was not declared in this scope 241 | glBindAttribLocation(shaderProgram, 0, "aVertexPosition"); | ^~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:243:5: error: ‘glBindFragDataLocation’ was not declared in this scope 243 | glBindFragDataLocation(shaderProgram, 0, "FragColor"); | ^~~~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:245:5: error: ‘glLinkProgram’ was not declared in this scope; did you mean ‘glHistogram’? 245 | glLinkProgram(shaderProgram); | ^~~~~~~~~~~~~ | glHistogram src/cube2equirect.cpp:247:5: error: ‘glGetProgramiv’ was not declared in this scope 247 | glGetProgramiv(shaderProgram, GL_LINK_STATUS, &status); | ^~~~~~~~~~~~~~ src/cube2equirect.cpp:253:31: error: ‘glGetAttribLocation’ was not declared in this scope 253 | vertexPositionAttribute = glGetAttribLocation(shaderProgram, "aVertexPosition"); | ^~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:257:25: error: ‘glGetUniformLocation’ was not declared in this scope 257 | cubeLeftUniform = glGetUniformLocation(shaderProgram, "cubeLeftImage"); | ^~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:264:5: error: ‘glUseProgram’ was not declared in this scope 264 | glUseProgram(shaderProgram); | ^~~~~~~~~~~~ make: *** [Makefile:34: objs/cube2equirect.o] Error 1
I don't know how to solve this, I am using Ubuntu and I need much a code like this for my projects.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.