google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.82k stars 1.89k forks source link

Binding error following redball tutorial #3195

Closed davidwarford closed 2 years ago

davidwarford commented 4 years ago

redball.html:1 Uncaught (in promise) BindingError {name: "BindingError", message: "function Engine.createCamera called with 0 arguments, expected 1 args!", stack: "BindingError: function Engine.createCamera called …)↵ at http://127.0.0.1:8080/filament.js:126:21"} this is following the red ball tutorial, can't find any info online so i figured it was a good idea to make an issue. I am using the javascript file from the web page and I am using the latest release of filament my html file looks like

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Filament Tutorial</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1">
    <style>
        body { margin: 0; overflow: hidden; }
        canvas { touch-action: none; width: 100%; height: 100%; }
    </style>
</head>
<body>
    <canvas></canvas>
    <script src="filament.js"></script>
    <script src="//unpkg.com/gl-matrix@2.8.1/dist/gl-matrix-min.js"></script>
    <script src="redball.js"></script>
</body>
</html>
romainguy commented 4 years ago

It seems like a version mismatch.

@prideout Are the tutorials up to date with all the recent API changes?

davidwarford commented 4 years ago

Oh... that's probably it then. Do you have advice for how to refactor the tutorials (Im really new to webdev)? i noticed that the triangle material is out of date when i was doing the triangle tutorial

prideout commented 4 years ago

The tutorials are out of date, which I will endeavor to update soon. Meanwhile you might want to look at web/samples, which are kept up to date (be aware of #3128 however)

prideout commented 2 years ago

I added some notes to #5530 regarding the state of JS documentation, closing this as a pseudo dup of that bug.