Cannot draw colors in a viewport #1966
Answered
by
tenfoldpaper
rohit-kumar-j
asked this question in
Asking for Help
-
Hi, ...
mjv_updateScene(sim->m_, sim->d_, opt, NULL, &offscreen_cam, mjCAT_ALL, scn);
mjr_render(viewport, &sim->scn, &sim->platform_ui->mjr_context());
mjr_readPixels(color_buffer, nullptr, viewport, &sim->platform_ui->mjr_context());
for(int i=0; i<VIEWPORT_HEIGHT; i++){
for(int j=0; j<VIEWPORT_WIDTH; j++){
int index = (i * VIEWPORT_WIDTH + j) * 3;
color_buffer[index] = 0; // Set Red component
color_buffer[index + 1] = 0; // Set Green component
color_buffer[index + 2] = 0; // Set Blue component
// printf("[%u %u %u]", r,g,b);
}
// printf("\n");
}
// printf("\n");
mjr_drawPixels(color_buffer, nullptr, viewport, &sim->platform_ui->mjr_context());
... Instead it just only shows a viewport with the camera view in the corner: Here is the source for the modified
|
Beta Was this translation helpful? Give feedback.
Answered by
tenfoldpaper
Nov 7, 2024
Replies: 1 comment
-
Hey Rohit, I've sort of figured out the issue here; while the overlay is only broadcasting the depth version of the main camera, I think the logic will be helpful. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rohit-kumar-j
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Rohit, I've sort of figured out the issue here; while the overlay is only broadcasting the depth version of the main camera, I think the logic will be helpful.