JohnnyDevNull / ng-three-template

This is a basic template project to start with Angular 17.x and ThreeJS
MIT License
228 stars 71 forks source link

SVGLoader doesn't exist #1

Closed DanielGSan closed 6 years ago

DanielGSan commented 6 years ago

Hi, First, great seed and job.

Second, I'm trying to load a SVG image as texture but I'm getting this error.

screenshot 2018-10-25 at 10 19 01

Link to docs -> https://threejs.org/docs/#examples/loaders/SVGLoader

Looks like that functionality is not in @types, do you know some solution?

Thanks in advance

JohnnyDevNull commented 6 years ago

I will take a look into this evening, maybe i only forgot to update the devDependencies. My @types/three version is older than the three dep.

npm show @types/three versions said that 0.93.4 is the actual and 0.92.14 is installed

Could you try npm install @types/three@latest --sev-dev pls?

EDIT (only a notice for myself): https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three

DanielGSan commented 6 years ago

I updated the dependency and the error continues appear.

I notice that probably there are not a correct type for SVGLoader...

https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three

Do you know how I can proceed?

JohnnyDevNull commented 6 years ago

You can proceed with a cast to any before using the Loader: (<any>THREE).SVGLoader()

DanielGSan commented 6 years ago

Hi, that error disappear, but the error still in compilation. I found here the problem also, but not solution yet.

https://discourse.threejs.org/t/augmenting-extending-three-types-with-typescript-d-ts/4245

If you want, we can close the issue, is not related to you seed.

JohnnyDevNull commented 6 years ago

Thanks for the link. I will take a look at, maybe i would have an idea.

JohnnyDevNull commented 6 years ago

Maybe this could help: https://www.npmjs.com/package/three-addons but i've not tried yet

DanielGSan commented 6 years ago

Maybe this could help: https://www.npmjs.com/package/three-addons but i've not tried yet

I will try later, thanks for you support!

DanielGSan commented 6 years ago

Hi! Good news! three-addons is deprecated -> https://github.com/marcofugaro/three-addons#readme But they links to -> 'three-full' https://github.com/Itee/three-full

And I saw that SVGLoader is included in that library!, so looks that they have support. I will close this issue, thanks for your support.

Thanks @JohnnyDevNull!

JohnnyDevNull commented 6 years ago

Hey thanks for the links, i will add it to my readme, so that others can find it much easier.