Skip to content

Threejs loaders example request #41

@lobis

Description

@lobis

I am trying to call three.js in the browser using Kotlin.

In my first attempt, I used the original three.js wrapper from Lars Ivar Hatledal, which this project also includes. I started from the examples in https://laptrinhx.com/kotlin-wrappers-for-three-js-2366010328/, but I quickly found out the newest version of Kotlin (1.4.32) does not work out of the box with it (problems with kotlin.browser.* vs kotlinx.browser.*) so I used the version distributed by visionforge instead.

I managed to render a simple cube successfully (based on the first example in the linked page).

However, I cannot get the Loaders to work, I failed to load an .stl model and an Object3D model. The code compiles correctly but I get the following errors in the browser:

For Object3D loader:
image

For JSON loader (Object3D):
image
This seems to be related to the fact that JSONLoader was removed in the r99 release of three.js (https://discourse.threejs.org/t/objectloader-not-loading-json-file/5213)

For the STL something similar happens.

To me it looks like there are some problems with the three.js wrapper, please correct me if I am wrong. I would appreciate an example on how to correctly call this methods. Also I couldn't get the dat.gui or stats to work following the example.

Here you can find an example project which reproduces this issues.

Thank you.

Luis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestgood first issueAn issue awaits its hero. Contributions are welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions