Create a 3D visualizer on my site using various images of the object from multiple perspectives

Looking to incorporate a 3D object into my website, but the file size is too large. I'm considering taking images of the object from various angles and utilizing code to create a visual 3D effect when users interact with them.

I was inspired by a website called pixelsquid that achieved a similar result. Currently exploring ways to replicate this on my own site.

If anyone has knowledge of libraries or code that could assist in achieving this effect, it would be greatly appreciated.

While aware of libraries that support full 3D objects, the file size of mine is prohibitive for this approach.

One proposed method involves creating a large grid image composed of smaller images arranged to simulate 3D movement. If there is a way to write code that can manipulate these images' positions for a realistic 3D effect, that would be ideal.

Answer №2

The answer I discovered for who would like is as follows:

const threeDObj = document.querySelector(".threeDObj");
let mouseMoveListenerActive = false;

        function mouseDownListener() {
            if (!mouseMoveListenerActive) {
                threeDObj.addEventListener("mousemove", mouseMoveListener);
                mouseMoveListenerActive = true;
            }
            console.log("Mouse down");
            threeDObj.innerHTML = "Mouse down";
        }

        function mouseMoveListener(event) {
            console.log("Mouse position: " + event.clientX + ", " + event.clientY);
            threeDObj.innerHTML = "Mouse position: " + event.clientX + ", " + event.clientY;
        }

        function mouseUpListener() {
            if (mouseMoveListenerActive) {
                threeDObj.removeEventListener("mousemove", mouseMoveListener);
                mouseMoveListenerActive = false;
            }
            console.log("Mouse up");
            threeDObj.innerHTML = "Mouse up";
        }

        threeDObj.addEventListener("mousedown", mouseDownListener);
        threeDObj.addEventListener("mouseup", mouseUpListener);
.threeDObj {
            user-select: none;
            -webkit-user-drag: none;
            -moz-user-select: none;
            -webkit-user-select: none;
            width: 1000px;
            height: 1000px;
        }
<p class="threeDObj">previous</p>

Instead of altering the text, I can now modify the image that I want to display based on a 3x16 array of img src's.

Special thanks to Nicholas for his assistance!

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

Moving specified data from one interactive table to another interactive table

In my setup, there are two tables - one for products and another for customers: <table cellpadding="0" cellspacing="0"> <thead> <tr> <th>Product Code</th> </tr> </thead> ...

Ways to transfer data between Angular controller and jQuery

Looking for some guidance on how to toggle between two HTML divs based on user input validation using an Angular controller and jQuery animations. Each div contains input fields that need to be validated before moving on to the next stage. Here is a simpli ...

Trouble aligning image in the middle with bootstrap

After attempting the solutions proposed in previous posts, I find myself sharing my amateur code where the embedded image refuses to center and I am at a loss as to why. The image is meant to be positioned in the middle of a login screen/box; it worked for ...

Displaying data from a table in a modal window using getSelected in Bootstrap-table

I am currently utilizing bootstrap and bootstrap-table, and I have a requirement to display the data of the selected item in a modal window. When I retrieve the information of the selected item: Here is my JavaScript code: var $table = $('#tableprod ...

Why is my React build's index.html coming up empty?

I've been working on a React app using Snowpack, and everything seems to be in order. The build process completes successfully, but when I try to open the index.html file from the build folder, the page appears blank. To temporarily resolve this issu ...

Troubleshooting bitrate and quality issues in AWS MediaConvert

Whenever I attempt to initiate a MediaConvert job in CBR, VBR, or QVBR mode with Bitrate or MaxBitrate exceeding 250,000, an error occurs. The message reads: "Unable to write to output file [s3:///videos//***/original.mp4]: [Failed to write data: Access D ...

Bootstrap Table Layout with gaps between rows, enclosed in a border with no borders inside cells

Does anyone know how to achieve this style using bootstrap 5? https://i.sstatic.net/BKDBy.png The table has space between the rows and a border around the rows, but no border between the columns. I've been attempting to recreate it for 4 hours witho ...

In AngularJS, the use of the '+' operator is causing concatenation instead of addition

Looking for assistance with my TypeScript code where I've created a basic calculator. Everything is working as expected except for addition, which seems to be concatenating the numbers instead of adding them together. HTML CODE : <input type="tex ...

Group a set of x elements together within a div, and then group a distinct number of elements together after every x-grouping

Is there a way to achieve a looping structure like this? For instance: Group every 2 divs into a new div, then (after every 2nd grouping) group every 3 divs together <div id="container"> <div></div> <div></div> ... </div& ...

`Storing modified PDF containing interactive form elements using integrated Chrome viewer and transferring it to a remote server`

Our current setup utilizes the default embedded Chrome PDF viewer to showcase a PDF document with interactive form fields, enabling users to conveniently fill out the form. Once completed, they can click on the download button to save the form with or with ...

Utilizing Mouseover Event to Create a Loop Function in Pure Javascript

My goal is to design a carousel with images and have it horizontally scroll when the user hovers over the left or right side of the div. I've created two "invisible" divs for the controls on the left and right, each equipped with eventListeners: righ ...

Tips on redirecting a user to a specific page after they have made a selection without doing so immediately

I am a beginner in the world of coding. Currently, I am working on creating templates for an online software application. Users will have the option to select from different choices using radio buttons. However, I want to ensure that users are not redirect ...

Combining two JSON objects into a single JSON object using Jquery/JavaScript

I need to combine two JSON objects into one, here are my current JSON objects: var obj_1 = { "?xml": {"version": "1.0", "encoding": "utf-8"}, "Template": { "Name": "Capital Goods-Tool and Die Maker L5 Set1", "Section": [{ "Id": "Section_ ...

Achieving proper stacking of a table with other div elements

I've come across some similar inquiries, but none seem to fully address the specific issue at hand. If there's an existing thread on this that I overlooked, I apologize in advance. So, here's a multi-part problem: my solution for the first ...

Background does not extend beyond the visible screen area

I'm currently working on a website project for the students at my school, but I've encountered a minor issue. When scrolling left or right, the background doesn't extend to cover the entire page; instead, it stops where the edge of the page ...

What is the best way to conceal a div when there are no visible children using AngularJS?

I need help with hiding a parent div only if all the child items are invisible. I have successfully hidden the parent when there are no children, but I am struggling to figure out how to hide it based on visibility. <div ng-repeat="group in section.gro ...

Is there any benefit to making the SVG elements width and height 100%?

The Angular Material documentation app features an SVG Viewer that is able to scale the SVG content to fit the container using the following function: inlineSvgContent(template) { this.elementRef.nativeElement.innerHTML = template; if (this.sca ...

Project in Three.js where the camera remains focused on the object while in a top-down perspective

I am currently working on developing a top-down game using Three.js, inspired by classic arcade games like Frogger. I am facing challenges in ensuring that the camera stays centered on the main character as it moves across the screen. I am currently util ...

What could be the reason for PassportJS in Node failing to clear the session upon logout?

I am encountering an issue with my system not successfully logging out using PassportJS. The logout route appears to be triggered, but the session is not being removed as intended. I would like it to return a 401 error if the user is not logged in on a spe ...

Angular2 - Access to fetch at 'https://example.com' from

Requesting some guidance on integrating the forecast API into my angular2 application. Currently facing a Cross-Origin Error while attempting to access the API. Any suggestions on resolving this issue? search(latitude: any, longitude: any){ consol ...