OBJLoader: Model not appearing in the scene

Hi all

This is my first post here as im quite new to three.js

I am currently playing around with a few code pens and essentially trying to mash the two below together

https://codepen.io/flashvenom/pen/PyOLoY
https://codepen.io/flashvenom/pen/VEybNB

And this is what I have come up with but my question is WHERE IS THE BANANA

https://codepen.io/flashvenom/pen/JmMyQK

any pointers or help would be much appreciated.

You are not adding the model to the scene in your onLoad() callback. Fixed in the following codepen:

1 Like

Hi Mugen

yes I see I had misplaced ‘scene.add( banana );’ works perfectly now, thanks for the quick reply

Just to add to this, I dont suppose you can see any reason why i cant load other models, im guessing they are not formatted correctly

Other models im trying to use

http://dev.danielwakefield.co.uk/DC2019/site/images/IphoneSE1.obj
http://dev.danielwakefield.co.uk/DC2019/site/images/DC-LOGO.obj

Unfortunately, the first link is dead. The second one works and I can load the file in the editor. So it looks like the OBJ is actually fine.

image

1 Like

Strange, ive tried to add into this pen but it just doesn’t show up, I thought it might be a scaling issue but that doesn’t seem to be the case either

Loading content via HTTP when the website runs in HTTPS is not allowed. But even if you change the protocol to HTTPS, you get a security error since dev.danielwakefield.co.uk does not allow cross origin requests.

1 Like

Yes just read about the same thing, although I did think my CORS plugin was causing the issue.
Just discovered the three.js editor too, thanks so much for your help, ill be back :slight_smile:

1 Like

Ive tried uploading it to a cdn but it just doesnt work, yet the banana does, any ideas, see the updated pen
https://codepen.io/flashvenom/pen/GYyQqx

Worked it out, it is the scale as the model is tiny upped by 100 and can now see it, thanks for alll your help again

Hi Mugen, thanks again for the tips, im learning loads, see my project so far.

https://codepen.io/flashvenom/pen/rqJBYx

Cheers

1 Like