jscastro76 / threebox

A Three.js plugin for Mapbox GL JS, with support for animations and advanced 3D rendering.
Other
549 stars 145 forks source link

Add with credentials to loadObj options #417

Closed manmaor closed 7 months ago

manmaor commented 8 months ago

Sometimes requests credentials are required to be successful, in my case it's requests to the AWS CDN. So I added withCredentials to loadObj options, so requests will have credentials.

options example:

  const windTurbineOptions = {
    obj: awsCdnUrl,
    type: 'gltf',
    scale: 1,
    units: 'meters',
    anchor: 'center',
    withCredentials: true,
  };
  tb.loadObj(windTurbineOptions, (model) => {
    const { longitude, latitude } = location
    model.setCoords([longitude, latitude, groundAlt]);
    tb.add(model);
  });
jscastro76 commented 8 months ago

This PR includes also a change in the vertex shader for buildings shadow

manmaor commented 8 months ago

@jscastro76 It seems that the build command generated these changes, Would you prefer that I will only upload the src changes?

jscastro76 commented 8 months ago

yes please, the credentials part wasn't an identified scenario, but I'm open to consider it. The vertex shader is something that requires a lot of tests before approval

manmaor commented 8 months ago

@jscastro76 Done 😄

manmaor commented 7 months ago

@jscastro76 Hi, Is there anything else that needs to be done to get this approved?

jscastro76 commented 7 months ago

Approved! Thanks for your contribution!