Jump to content

Use the viewer for simple 3D rotation product in web (error)


kinometal
 Share

Recommended Posts

 

Hello to all :)

Im noob with Babylon and i have a problem when i try to test one object exported from Blender.

I will use the viewer for simply 3D rotation in online shop for see the product. The official test from viewer (boombox.glb) works fine in my computer without problem.

When I try to test my 3D objects exported from Blender in Babylon Editor or in SandBox i dont have a problem, I can see the object correctly, but when I try to execute in local or in website, no run, no work the viewer, freeze the screen in the square pre loader :(

Im reading and try a lot of configs but i dont solve it.

The code im using is the example of the test viewer, and I change the "boombox.glb" for my object exported from Blender in stl, glb or .babylon extension, but not work in any:

<html>
<head>
  <title>Babylon.js Viewer - Display a 3D model</title>
  <script src="https://preview.babylonjs.com/viewer/babylon.viewer.js"></script> 
</head>
<body>
    <babylon model="https://models.babylonjs.com/boombox.glb" templates.main.params.fill-screen="true"></babylon>
</body>
</html>

In the debug appear this error: babylon.viewer.js:19 BJS - [16:59:48]: No URL provided
t._ErrorEnabled @ babylon.viewer.js:19

Thank you for your help,

Kino

Link to comment
Share on other sites

im not expert  in standalone html js usage with babylonjs

but.... it says clearly that u didnt specify the correct url in the js file u want html to load...

so show us the viewer.js file instead on line 19 u find the error?

i checked fast to just check i found this

<script src="https://cdn.babylonjs.com/viewer/babylon.viewer.js"></script>

 

Link to comment
Share on other sites

no everything works for me in localhost.

Your problem is that u give us 2 files that doesnt even belong in the code

u need to change the model url to ur file.

and it should work

ur files doesnt work i tested it try a glb file the example works though

i tried babylon file with a skull it works perfecet ur file is either not accible or corrupt

Link to comment
Share on other sites

I updated the path and now appears this error: "Error loading the model".

In the debugger appears now: Access to XMLHttpRequest at 'http://carpas.net/3d/brezza.stl' from origin 'http://www.carpas.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Link to comment
Share on other sites

yea follow deltakosh i dont think u know very much if u have cors problem its not really related to babylonjs.....

i think u need easiest way is to upload file somewhere else.

i doubt u can easy fix problem on ur own

cor problem is fixed by sending headers in ur request or by allowing loxalhost42000 in server file

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...