CesiumGS / CesiumGS/cesium

Box entity with heightReference: CLAMP_TO_3D_TILE not working correctly on 3D Tiles (CesiumJS 1.133)

Open
#12,935 1 comment 0 reactions 0 assignees View on GitHub
type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

### What happened?

When placing a Box entity above a building in a 3D Tileset (Ion asset 75343, NYC), assigning box.heightReference = Cesium.HeightReference.CLAMP_TO_3D_TILE does not align the box with the building (picked roof) surface. Instead, the box ignores the supplied height but appears at ground/ellipsoid level (lower than the picked rooftop). I did not enable or test real terrain (only default ellipsoid). A box placed directly at scene.pickPosition sits correctly on the rooftop, so the pick is valid. This suggests CLAMP_TO_3D_TILE for Box is not applying 3D Tiles surface clamping in 1.133.

### Reproduction steps

1. Use CesiumJS 1.133 (unmodified build, default terrain/ellipsoid only).
2. Load 3D Tiles (Ion asset ID 75343).
3. Left-click a building roof; obtain position via scene.pickPosition (works).
4. Add:
- Box A: position = pickPosition (expected rooftop; renders correctly).
- Box B: position = Cesium.Cartesian3.fromDegrees(lon, lat, 1500) with box.heightReference = CLAMP_TO_3D_TILE (expected: rooftop; actual: drops to ground/ellipsoid, not roof).
5. Optionally add Box C: manual offset (picked height + 5 m) to confirm baseline.
6. Expected: Box B clamps to 3D Tiles surface (same base height as Box A).
7. Actual: Box B ignores provided altitude but does not use building surface—appears at lower ground/ellipsoid level. No console errors.

### Sandcastle example

https://dev-sandcastle.cesium.com/#c=tVdtbxo5EP4rc3xartQkJbQnklRHgKqoNIkS7qpKSJHZNWDV2CvbC+Wq/PcbvywshDZ3V92HKPhlZp4ZP/OyzSbcsVyrrEgtV7IDvVH34+3D+Oah1X8YD0cDUBKu1Fdg0nK7AakspIIucy7nYBW0+jDmghkwhZ7RlAGX0GOGF0s4JaetFpnIZhPuLctNx/88JTBSNAPrpJiFZIgGqHE/37RbZy14CdefezAtuMjQhqkHDa8I9ARPvzg427Nw1CLoQgZTBJlkXLPUQo43b5XhzqU6c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1VzTfMFTX9W2HlTf+nwnL5TcSceSVVZCrxt5IOe+y+6JUfucGLVbqUiLqw50rWXL3G5bPdaISvfnc6k027b10PkdHa5GfwyikqEMww/YBc4emcLx6PpmHLUdG5pmODK4IWvO1JJZvSH/kFg9p/FZXv24l2DsGi5WoYdg/UcHRlTPy2HDAXaDCt5x49dsO/4d4+jTUSrYfr+/Tw4nrMb/QnL3JHss/xmSf3o/HA+OkRzj1evAxzDFaeZItWKAg9KKhhLyog040vnh7GCcewmfB6PRzacdacMU2IsZcxCBMmsOWd+AfT6X6/iAL6BdzYuADFFcfocZ5TgQh4kdoorFI2el8adHAYfb3xumfsTsGy8egvoswUuP/mPZxPHJTVBnz/IpPNYeo17/BKP63bsPD7GLHKucuw5361pU1oHweZNgc8c89XmYTPEzBhch3MnGf1zgN5Nvfo+N781N403OyGjwbvzQGw17H4JVJPJN7iKKPE4FoxrTWeT4QSC345LfHsR3K4fuw+fUbKlWrCtEcmxQ7DkVLCshTuSay0ytiVftC5r7JEBy7tk6rzVqF8ZuBHvrVP4ev34KLRJCmq5gI/+YaU4LTDBLUuM7yEWzFLnI+Ap4dnnka8cF0hg8mRVC3PO/2KT29qKJ9/fE3JiKRe8GJ1pBN+7K4vTtKGwSQi6auHwqZZXCKU1XNP4N

### Environment

Browser:140.0.7339.208
CesiumJS Version:1.133.0
Operating System:Windows 11

Contributor guide

Open the contributing guide

Research direction

Start with the linked Sandcastle example and reproduce the behavior using CesiumJS 1.133, Ion asset 75343, and default ellipsoid terrain. Compare Box A at scene.pickPosition with Box B using CLAMP_TO_3D_TILE; done means Box B uses the building surface and matches Box A's base height without console errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.