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

The viewer linked to glTF Asset Generator is out of date #33

Closed
cx20 opened this issue Aug 1, 2020 · 8 comments · Fixed by bghgary/glTF-Assets-Viewer#13
Closed

The viewer linked to glTF Asset Generator is out of date #33

cx20 opened this issue Aug 1, 2020 · 8 comments · Fixed by bghgary/glTF-Assets-Viewer#13
Assignees
Labels
bug Something isn't working

Comments

@cx20
Copy link

cx20 commented Aug 1, 2020

It may already be scheduled to be fixed, but I'll report back Issue just in case.

The old playcanvas-gltf viewer is referenced by the Khronos glTF Asset Generator.
https://github.com/KhronosGroup/glTF-Asset-Generator

Perhaps modifying the following configuration file will refer to the new viewer.
https://github.com/bghgary/glTF-Assets-Viewer/blob/master/engines.json

"PlayCanvas": {
    "templateUrl": "https://playcanvas.github.io/playcanvas-gltf/viewer/index.html?assetUrl=${assetUrl}&cameraPosition=${-cameraPosition.x},${cameraPosition.y},${cameraPosition.z}"
},
@cx20
Copy link
Author

cx20 commented Aug 2, 2020

It seems that it was merged into engines.json, but the viewer doesn't seem to display properly.
PlayCanvas Viewer doesn't seem to work properly with iframe.

https://bghgary.github.io/glTF-Assets-Viewer/?manifest=https://raw.githubusercontent.com/KhronosGroup/glTF-Asset-Generator/master/Output/Positive/Manifest.json&folder=19&model=0

<iframe src="https://playcanvas.com/viewer/?assetUrl=https://raw.githubusercontent.com/KhronosGroup/glTF-Asset-Generator/master/Output/Positive/Node_Attribute/Node_Attribute_00.gltf&cameraPosition=0,20,-20">
</iframe>

Mixed Content: The page at 'https://bghgary.github.io/glTF-Assets-Viewer/?manifest=https://raw.githubusercontent.com/KhronosGroup/glTF-Asset-Generator/master/Output/Positive/Manifest.json&folder=19&model=0' was loaded over HTTPS, but requested an insecure frame 'http://playcanvas.com/viewer?assetUrl=https://raw.githubusercontent.com/KhronosGroup/glTF-Asset-Generator/master/Output/Positive/Node_Attribute/Node_Attribute_00.gltf&cameraPosition=0,20,-20'. This request has been blocked; the content must be served over HTTPS.

@willeastcott
Copy link
Contributor

I'm not sure where the http protocol is being used (instead of https). In the engines.json, I used https.

@cx20
Copy link
Author

cx20 commented Aug 2, 2020

I tried the iframe in jsfiddle and the Babylon.js and three.js viewers seemed to be able to display in the iframe as well.
I think it's a problem with some settings on the PlayCanvas Viewer side, but I didn't understand the cause.

https://jsfiddle.net/cx20/jszda6fu/9/

<!-- Babylon.js -->
<!--
<iframe src="https://sandbox.babylonjs.com/index.html?assetUrl=https://raw.githubusercontent.com/KhronosGroup/glTF-Asset-Generator/master/Output/Positive/Node_Attribute/Node_Attribute_00.gltf&cameraPosition=0,20,-20&kiosk=true"></iframe>
-->
<!-- PlayCanvas.js -->
<iframe src="https://playcanvas.com/viewer/?assetUrl=https://raw.githubusercontent.com/KhronosGroup/glTF-Asset-Generator/master/Output/Positive/Node_Attribute/Node_Attribute_00.gltf&cameraPosition=0,20,-20"></iframe>
<!-- three.js -->
<!--
<iframe src="https://gltf-viewer.donmccurdy.com/#model=https://raw.githubusercontent.com/KhronosGroup/glTF-Asset-Generator/master/Output/Positive/Node_Attribute/Node_Attribute_00.gltf&cameraPosition=0,20,-20&kiosk=true&preset=assetgenerator"></iframe>
-->

@willeastcott
Copy link
Contributor

Yeah, this is probably something configured on playcanvas.com to prevent other sites iframing pages. @yak32 @slimbuck @vkalpias Would it be possible to relax this just for the viewer?

@slimbuck
Copy link
Member

slimbuck commented Aug 3, 2020

Removing the params from the fiddle URL gives this slightly more useful error:
Refused to display 'https://playcanvas.com/viewer' in a frame because it set 'X-Frame-Options' to 'deny'.

@slimbuck slimbuck added the bug Something isn't working label Aug 3, 2020
@yak32
Copy link
Contributor

yak32 commented Aug 3, 2020

yes, we set X-Frame-Options to deny explicitly, to avoid click-jacking attacks, but we can whitelist certain websites.

@yak32
Copy link
Contributor

yak32 commented Aug 3, 2020

we are going to whitelist the site soon.

@cx20
Copy link
Author

cx20 commented Aug 7, 2020

Thank you for your cooperation. I have confirmed that the viewer is displayed.
image

@cx20 cx20 closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants