Unable to properly draw meshes with mjv_initGeom
.
#2627
-
IntroHi! I am a graduate student at Faculty of Electrical Engeneering, University of Ljubljana, I use MuJoCo for my research on reinforcement learning. My setupI am using the latest version the MuJoCo C library, linked with Rust on Ubuntu 25.04. My questionI am trying to visualize some geoms via the EDIT: it seems to work with other geoms, just not this specifically, is there some setting that simplifies the model? Here is an example of what happens: Minimal model and/or code that explain my questionHere's a snippet from my code. Although this isis Rust, I still use the C api mostly directly as I have nothing but a slim wrapper around it, thus this isn't the issue with my code . Code: let geom_ptr = raw_scene.geoms.add(raw_scene.ngeom as usize);
mujoco_rs::mujoco_c::mjv_initGeom(
geom_ptr,
mjtGeom__mjGEOM_MESH as i32,
std::ptr::null(),
std::ptr::null(),
std::ptr::null(),
std::ptr::null(),
);
raw_scene.ngeom += 1;
let geom = geom_ptr.as_mut().unwrap();
geom.dataid = mesh_id;
geom.dataid = mesh_id; // mesh index from mjModel
geom.objtype = mjtObj__mjOBJ_UNKNOWN as i32;
geom.category = mjtCatBit__mjCAT_DECOR as i32;
geom.pos = pos_xyz;
geom.size = [1.0, 1.0, 1.0]; Confirmations
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solved, by changing |
Beta Was this translation helpful? Give feedback.
Solved, by changing
geom.dataid = mesh_id;
togeom.dataid = mesh_id * 2;
. Can also bemesh_id * 2 + 1
for the convex hull.