Skip to content

Commit

Permalink
Fix scale and rotation issues in granular collision SDF
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-eric committed Jan 3, 2025
1 parent be20675 commit 961d57f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
- Fix allocating arrays with strides ([GH-404](https://github.com/NVIDIA/warp/issues/404)).
- Fix `ImportError` exception being thrown during `OpenGLRenderer` interpreter shutdown on Windows
([GH-412](https://github.com/NVIDIA/warp/issues/412)).
- Fix scale and rotation issues with the rock geometry used in the granular collision SDF example
([GH-409](https://github.com/NVIDIA/warp/issues/409)).

## [1.5.1] - 2025-01-02

Expand Down
9 changes: 4 additions & 5 deletions warp/examples/sim/example_granular_collision_sdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# Note: requires a CUDA-capable device
###########################################################################

import math
import os

import numpy as np
Expand Down Expand Up @@ -66,8 +65,8 @@ def __init__(self, stage_path="example_granular_collision_sdf.usd"):
sdf=rock_sdf,
body=-1,
pos=wp.vec3(0.0, 0.0, 0.0),
rot=wp.quat_from_axis_angle(wp.vec3(1.0, 0.0, 0.0), -0.5 * math.pi),
scale=wp.vec3(0.01, 0.01, 0.01),
rot=wp.quat(0.0, 0.0, 0.0, 1.0),
scale=wp.vec3(1.0, 1.0, 1.0),
)

mins = np.array([-3.0, -3.0, -3.0])
Expand Down Expand Up @@ -149,13 +148,13 @@ def render(self):
with wp.ScopedTimer("render"):
self.renderer.begin_frame(self.sim_time)

# Note the extra wp.quat_from_axis_angle(wp.vec3(1.0, 0.0, 0.0), math.pi) is because .usd is oriented differently from .nvdb
self.renderer.render_ref(
name="collision",
path=os.path.join(warp.examples.get_asset_directory(), "rocks.usd"),
pos=wp.vec3(0.0, 0.0, 0.0),
rot=wp.quat(0.0, 0.0, 0.0, 1.0),
scale=wp.vec3(0.01, 0.01, 0.01),
scale=wp.vec3(1.0, 1.0, 1.0),
color=(0.35, 0.55, 0.9),
)

self.renderer.render_sphere(
Expand Down

0 comments on commit 961d57f

Please sign in to comment.