Closed zcczhang closed 1 year ago
The code I used below for NVISII box mesh will somewhat create the box with incorrect dimensions. Other primitives work fine but maybe I'm missing something in loading the NVISII box mesh?
nv_objects[object_name] = nv.entity.create(
name=object_name,
mesh=nv.mesh.create_box(
name=object_name,
size=nv.vec3(dimensions[0], dimensions[1], dimensions[2])
),
transform=nv.transform.create(object_name),
material=nv.material.create(object_name),
)
Edited: nvm, just found that the size
in create_box
is half size. Dividing dimensions by 2 works, and I'll push accordingly
nv_objects[object_name] = nv.entity.create(
name=object_name,
mesh=nv.mesh.create_box(
name=object_name,
size=nv.vec3(dimensions[0] / 2, dimensions[1] / 2, dimensions[2] / 2)
),
transform=nv.transform.create(object_name),
material=nv.material.create(object_name),
)
Ok, looking better.
Could you explain what the pybullet_data package does? I’m unfamiliar with that.
Otherwise looks good to me
Thanks for contributing! 🙂
Just glancing at the code atm, why not use the built in NVISII box mesh rather than importing a box obj? I tend to prefer we use the built in primitives that come with NVISII rather than sourcing them from an external OBJ