Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sb6code / src / spinnycube / spinnycube.cpp why do unnecessary VertArray allocation? #23

Open
legezam opened this issue Aug 21, 2014 · 0 comments

Comments

@legezam
Copy link

legezam commented Aug 21, 2014

In sb6code / src / spinnycube / spinnycube.cpp, around line #98:
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
then the code fills vertex_positions -> unrelated
glGenBuffers(1, &buffer);
glBindBuffer(GL_ARRAY_BUFFER, buffer);

It seems to me that the VA generated for vao is never used. (Or did i miss anything? - if i comment it out, the code works fine)

Second issue: (at around line #186)
vmath::mat4 mv_matrix = vmath::translate(0.0f, 0.0f, -6.0f) *
vmath::rotate((float)currentTime * 45.0f, 0.0f, 1.0f, 0.0f) *
vmath::rotate((float)currentTime * 21.0f, 1.0f, 0.0f, 0.0f) *
vmath::translate(sinf(2.1f * f) * 2.0f,
cosf(1.7f * f) * 2.0f,
sinf(1.3f * f) * cosf(1.5f * f) * 2.0f);
If i use the transformations in this order, the cube leaves the screen. If i flip the translations with rotations, the cube starts rotating around its local axes -> looks better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant