Skip to content

Commit

Permalink
fixed naming issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineRichard committed Aug 30, 2024
1 parent 409af53 commit 821339a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions geometric_clip_map_demo_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from pxr import UsdLux
from WorldBuilders.pxr_utils import setDefaultOps, addDefaultOps
import numpy as np
from src.terrain_management.large_scale_terrain.geometric_clipmaps import GeoClipmapSpecs
from src.terrain_management.large_scale_terrain.geometric_clipmaps_manager import (
from src.terrain_management.large_scale_terrain.geometry_clipmaps import GeoClipmapSpecs
from src.terrain_management.large_scale_terrain.geometry_clipmaps_manager import (
GeoClipmapManager,
GeoClipmapManagerConf,
)
Expand All @@ -26,7 +26,13 @@
minimum_target_resolution=0.01,
)

cfg = GeoClipmapManagerConf(root_path="/World", geo_clipmap_specs=specs, mesh_position=np.array([0, 0, 0]), mesh_orientation=np.array([0, 0, 0, 1]), mesh_scale=np.array([1, 1, 1]))
cfg = GeoClipmapManagerConf(
root_path="/World",
geo_clipmap_specs=specs,
mesh_position=np.array([0, 0, 0]),
mesh_orientation=np.array([0, 0, 0, 1]),
mesh_scale=np.array([1, 1, 1]),
)

world = World(stage_units_in_meters=1.0)
stage = get_context().get_stage()
Expand All @@ -37,13 +43,11 @@
addDefaultOps(light.GetPrim())
setDefaultOps(light.GetPrim(), (0, 0, 0), (0.383, 0, 0, 0.924), (1, 1, 1))

GCM = GeoClipmapManager(
cfg, interpolation_method="bicubic", acceleration_mode="hybrid"
)
GCM = GeoClipmapManager(cfg, interpolation_method="bicubic", acceleration_mode="hybrid")
dem = np.load("assets/Terrains/SouthPole/NPD_final_adj_5mpp_surf/dem.npy")
GCM.build(dem, dem.shape)
C = 2000 * 5
R = 0#500 * 5
R = 0 # 500 * 5
rotation_rate = 2048
spiral_rate = 2.0 / rotation_rate
theta = np.linspace(0, 2 * np.pi, rotation_rate)
Expand All @@ -52,9 +56,7 @@
i2 = 1.0
while True:
GCM.updateGeoClipmap(
np.array(
[C + i2 * R * math.cos(theta[i]), C + i2 * R * math.sin(theta[i]), 0]
),
np.array([C + i2 * R * math.cos(theta[i]), C + i2 * R * math.sin(theta[i]), 0]),
np.array([i2 * R * math.cos(theta[i]), i2 * R * math.sin(theta[i]), 0]),
)
world.step(render=True)
Expand Down

0 comments on commit 821339a

Please sign in to comment.