Adding a shadow to a 3D model with Threebox

I am currently working on a project utilizing threebox js and attempting to incorporate shadows for imported 3D models. Following the guidelines outlined in the documentation here. When creating an object, I adjust the property to TRUE (code snippet provided below).

window.tb.loadObj(proptions, function (model) {
    model.setCoords(place);
    model.addTooltip("A radar in the middle of nowhere", true);
    model.setRotation({ x: 0, y: 0, z: Math.floor(Math.random() * 100) })
    model.castShadow = true;
    window.tb.add(model);

});

After implementing this approach, here is the result: https://i.sstatic.net/6DCQ2.png

Issue Resolved

Following @jscastro's response, it was identified that the 3D model used had its own light source which interfered with the scene lights. Refer to @jscastro's detailed explanation for more information.

Answer №1

The issue at hand with the bus stop model from sketchfab is that it contains embedded lighting below ground level, which is disrupting the shadows in the scene within threebox. https://i.sstatic.net/W6E91.png

This is what causes the shadow problem when loading the model in threebox. I have successfully loaded all your models in threebox without any issues and displayed a tooltip, including the bus stop. https://i.sstatic.net/DfGsd.png

If you are set on using that bus stop model, you will need to make modifications using Three.js editor by removing the light source and then re-exporting it.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

A guide on setting up fixed row numbers in MUI-X DataGrid

One challenge I am facing is rendering the row numbers in a table so that they remain static even when columns are sorted or filtered. I attempted to use the getRowIndexRelativeToVisibleRows method of the grid API, but unfortunately, it does not work as ex ...

Is there a solution to prevent the "NavigationDuplicated" error in Vue.js when adding query parameters to the URL without changing the path?

Presently, the URL shows /search The new URL should display /search?foo=bar I am looking to modify my query parameters on the current route after applying some filters on the page. This is my code: this.$router.push({query: params}) Although I can h ...

Is there a way to eliminate all Unicode characters from a string while preserving specific languages like Japanese, Greek, Hindi, and others?

Is there a way to eliminate all Unicode characters from this text【Hello!】★ ああああ I want to get rid of any unusual symbols (【, ★, 】) while retaining "Hello!" and "ああああ". It should work for all languages, not just Japanese. ...

Reposition checkbox within dropdown list

To create a dropdown menu with textboxes, I implemented the code found in this Stack Overflow answer: Now, I am looking to reposition the dropdown menu to align with a specific piece of text, preferably to the right side of the 'Textpiece'. I at ...

The first parameter needs to be either a string, a buffer instance, or a uint8array. Null received

Encountering an error with my Node.js code and I'm not sure how to fix it. The error message reads: "First argument must be of type string or an instance of buffer or uint8array. Received undefined" I admit that I am new to Node.js and would apprecia ...

What is the best way to invert the positioning of the li elements to move upwards?

https://i.stack.imgur.com/mZaoS.png Seeking assistance on adjusting the height of bars to start from the bottom and go upwards instead of starting from the top position and going downwards. The JavaScript code below is used to generate the li elements and ...

What could be causing Vite to not locate the '.vue' loader during the Vue 3 migration build process?

Currently in the process of upgrading a Vue 2 project to Vue 3 by utilizing the migration build and vite (https://v3-migration.vuejs.org/breaking-changes/migration-build.html#overview) I've completed steps 1-4 (skipping 4 as I'm not using typesc ...

What could be causing the React state not to update properly?

Having an issue with my Alice-Carousel in react. I'm fetching items from an API and updating the array for the carousel, but the value of items keeps coming back as undefined. Using CryptoState context to avoid prop drilling. import React from 'r ...

When the page is refreshed, the JWT token mysteriously disappears from the header. How can this issue be resolved

I am currently using Jwt token based authentication with Angular 7 and node.js. When attempting to send a POST request with a Token to the server, everything works fine initially. However, upon reloading the page, I encounter an error on the server side. ...

Issue with Google Charts where the label does not show outside of the bar if the bar is too small

I am encountering an issue with my Google Bar Chart where the bar label is not displaying outside of the bar when it is too large to fit inside. This behavior should be the default, but my charts are not working as expected. The problem can be seen in rows ...

Check if the element with the ID "products" exists on the page using JQuery. If it does, then execute a certain action

Is there a way to create a conditional statement that executes if the element with the ID "products" is present in the HTML code? Thanks in advance for your help! Pseudo code using JavaScript (JQuery) if ( $('#products').length ) { // do s ...

Modify this tooltip feature to delay the hiding of the tooltip by x seconds

I have successfully created a tooltip using the following link: http://jsfiddle.net/GLZFc/ Currently, the tooltip works perfectly fine. However, I would like it to hide after x seconds of inactivity. Additionally, if I mouse over it again, I would like th ...

The error message "Type 'Observable<void>' cannot be assigned to type 'void | Action | Observable<Action>' when integrating an effect" is displayed

Encountering an error when trying to add effects using the 'run' method. Attempted to manually return a string, number, and other types, but nothing seems to work. Here is the effects code snippet: @Effect() getRoles$: Observable<Roles[]> ...

The Resharper guideline "Function Parameter" doesn't allow the usage of AngularJS service names

I have a question regarding naming conventions in my AngularJS app. Currently, all my service names start with an uppercase character. However, I am facing an issue where service parameters must match the service name, but Resharper's JavaScript "Func ...

I have been working on developing a Chrome extension for a StopWatch, but I am facing an issue where the Stopwatch resets automatically whenever I click

I am currently working on a stopwatch chrome extension and facing an issue where clicking anywhere outside the extension popup resets the stopwatch to zero. I would like the stopwatch to keep running until I manually stop it or close the browser. Can someo ...

An effective method for regularly uploading JSON data to the backend

As a newcomer to JS development, I am seeking advice on implementing a solution for efficiently loading a large amount of data into backend memory periodically. The goal is to have this data readily available for the UI without causing delays. Here's ...

Eliminate set of dates utilizing a different set of dates

Utilizing the MultipleDatePicker plugin to enable selection of multiple dates within a year. I have incorporated a checkbox feature that, when checked, will automatically mark all Sundays in the calendar. However, an issue arises when unchecking the check ...

Ldap.js: exploring nested searches

My current task involves using ldapjs to conduct a search where the filter is dependent on the outcome of a preceding search. ldapClient.search(base1, opts1, (err1, res1) => { res1.on("searchEntry", entry => { const myObj = { attr1: entr ...

There was a SyntaxError that caught me by surprise in my Javascript code when it unexpectedly encountered

I have been encountering an error in my code consistently, and I am struggling to comprehend why this is happening. The problematic area seems to be in line 29 of my Javascript file. HTML <link href="Styles12.css"; type="text/css" rel="stylesheet"> ...

Comparing jQuery and Yahoo UI API Design

I find myself puzzled by the contrasting design approaches of jQuery and Yahoo UI APIs. I must confess, I have a strong aversion to the jQuery API, but my knowledge in web programming and JavaScript is limited, so I could be completely mistaken and end up ...