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

Use with OBJLoader #24

Open
thomasFoglia opened this issue Jun 4, 2022 · 3 comments
Open

Use with OBJLoader #24

thomasFoglia opened this issue Jun 4, 2022 · 3 comments

Comments

@thomasFoglia
Copy link

Hi,

It's not working with OBJLoader elements instead of ConeGeometry elements.

Do you have any working snippets ?

Thanks :)

@noisyneuron
Copy link
Contributor

Hi @thomasFoglia

The type of object used would not impact the controls - perhaps a quick test would be to test loading the .obj in a simple scene without the controls, or the three.js editor to ensure the file loads as expected.

Feel free to share some code too.

@thomasFoglia
Copy link
Author

Hello,

the OBJ file is valid in the threejs editor.

The OBJ is loaded correctly, I have no error in the console.
Without the plugin, the OBJ is visible in the scene.

here is a codepen (it doesn't work because of the dependencies but all the code is there) : https://codepen.io/thomasfoglia/pen/oNEMOBo

my custom code starts on line 145.
do you have any ideas ?
thanks again !

@noisyneuron
Copy link
Contributor

Hey,

My apologies - I realize the example code can be a little confusing by including the spherical coordinate calculations - that in itself is not important for the controls.

I think the problem in your example is with the calculation of the camera positions.

I would suggest using the camera helper example to be able to freely move around the scene and store the camera positions as appropriate. You can remove lines 37-69 in script.js and replace that with the OBJ loader code, and just add the meshes to the scene.

Hope that helps! I'm in a period of low availability right now, but can update the examples soon to make things less confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants