Panda3D WebGL Port!


Thanks @rdb That was the problem.

How do I generate the .bc files like those used in the --preload-file argument in

I’m trying to get a project with multiple files running. I assume generating .bc files would be the best way to do this, but I don’t know if it would be the most easy to use for others once I have it setup.

Now, I have the editor working in an Angular JS project. Hopefully, it’s a short ride to Android using Cordova after that. If anyone’s interested, I plan to post a seed project to Github. (I tried Angular 6 & 7, but I couldn’t get it to play nice after ~10 days. Angular JS took 2.)


It seems I’m close to getting a project up using freezer.addModule. Now I’m getting errors about missing Python modules. This one and another from collections saying no operator module exists. I see an “operator.bc” and an “itertools.bc” in the python-modules folder. So, I’m not sure why the error?

File "heapq", line 132, in 
ImportError: No module named itertools

When I add these to the bottom of your I get the following error.

import itertools
import operator
import collections
import heapq

" Loading…
Downloading data…
Invalid function pointer called with signature ‘vii’. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)
Build with ASSERTIONS=2 for more info.


The .bc files are emscripten-generated bytecode files produced as result of building Python and Panda3D.

This is not the same as the files that are passed to --preload-file, which become part of emscripten’s virtual file system. You can just pass any files you like using as many of these options as it takes. It is also possible to package all your assets as a .mf and then mount that in your Panda game using the virtual file system, though.

Make sure that the itertools.bc is actually being added by freezify as part of the command-line.

As for the error message, this indicates an issue with CPython which violates the C standard on casting incompatible function pointers in a lot of different places. I’ve fixed many cases where it does this, but there may be missing cases. If you add -s ASSERTIONS=2 it will add more debugging information which will help track down which specific function call needs to be fixed in CPython.


I posted an angular project with some instructions on how to git it running. With the instructions and those I gave above, you should be able to compile your own and switch it out for the /app/panda-engine/panda-engine27.js file.

It’s just a starting point. I believe you can use Cordova to get on Android or IPhone, but I haven’t gotten that far.