Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Billboard using alignedAxis not aligned with the path direction in 2D mode. #10965

Closed
johnnylc opened this issue Dec 19, 2022 · 2 comments · Fixed by #10966
Closed

Billboard using alignedAxis not aligned with the path direction in 2D mode. #10965

johnnylc opened this issue Dec 19, 2022 · 2 comments · Fixed by #10966

Comments

@johnnylc
Copy link

Using the CZML sandcastle(https://sandcastle.cesium.com/?src=CZML%20Path.html), I set

alignedAxis: {
        velocityReference: '#position'
}

to billboard to make billboard's direction following the path direction.

In 3D mode the result seems ok, but in 2D mode the billboard's heading is not aligned with the path's direction.
The same scenerios in 2D and 3D mode are as below:
2D:
2d
3D:
3D

Sandcastle example:
https://sandcastle.cesium.com/?src=CZML%20Path.html

Browser:
Chrome 108.0.5359.125
Operating System:
Windows 11

@johnnylc johnnylc changed the title Billboard using alignedAxis not algned with the entity path direction in 2D mode. Billboard using alignedAxis not aligned with the path direction in 2D mode. Dec 19, 2022
@ggetz
Copy link
Contributor

ggetz commented Dec 19, 2022

I'm getting what looks like correct results in both 3D and 2D if I replace the following line in BillboardCollectionVS.glsl:

            vec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);

with

            vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);

czm_modelView3D should account for differences in the camera between 3D and 2D mode.

@johnnylc
Copy link
Author

Thanks for the fix. It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants