Forum Discussion
AugmaDev
4 years agoExplorer
Editing Cubes in hello_xr Android Studio
How can I change the color of the cubes in hello_xr from Android Studio?
I have very little experience with Android Studio, but I can run hello_xr on on my Quest 2 and I understand OpenGL C++. I tried looking at some of the .c and .cpp files, but Android Studio tells me "This file does not belong to any project target; code insight features might not work properly."
Yes, in the hello_xr demo app, there only one OpenGL resource (vertices and colors) for all the cubes (defines in InitializeResources), so you must refines the source code to create diffrerents resources and manage differents cubes.
The hands cubes are created on the fly in the "openxp_program.cpp" file at the "RenderLayer" function; search for the line with "for (auto hand : {Side::LEFT, Side::RIGHT})".
Cheers
3 Replies
- antoine.emeritExplorer
Hi,
The cube vertices array contains also the face colors, and is defined in the file geometry.h in the c_cubeVertices array.
Je cube's color is send to the OpenGLES shader in the "graphicsplugin_opengles.cpp" file at the end of the "InitializeResources" function.
Regards- AugmaDevExplorer
Great thanks!
This works, but it ends up changing the color of every cube in the scene. It looks like c_cubeVertices is used several times to create several instances of the cube. Do you happen to know which file has the OpenGL code for creating the cube on the right controller?- antoine.emeritExplorer
Yes, in the hello_xr demo app, there only one OpenGL resource (vertices and colors) for all the cubes (defines in InitializeResources), so you must refines the source code to create diffrerents resources and manage differents cubes.
The hands cubes are created on the fly in the "openxp_program.cpp" file at the "RenderLayer" function; search for the line with "for (auto hand : {Side::LEFT, Side::RIGHT})".
Cheers
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 10 months ago
- 4 months ago