Guide on displaying numerous videos on a spherical surface with three.js

As someone new to Three.js, I'm facing a bit of a challenge with this.

I came across a possible solution here: Using multiuple textures on a sphere [Three.js]

The suggestion in the answer is to use a cube to load textures onto instead of a sphere. By doing this, the cube can then be expanded into a sphere.

var geometry = new THREE.BoxGeometry( 1, 1, 1, 8, 8, 8 );
for ( var i in geometry.vertices ) {
    var vertex = geometry.vertices[ i ];
    vertex.normalize().multiplyScalar(radius);
}

var materialArray = [];
var faceMaterial = new THREE.MeshLambertMaterial({
    color: sphereColor,
    transparent: true,
    opacity: 0.4
});
for (var i = 0; i < 6; i++) {
    materialArray.push(faceMaterial);
}

var material = new THREE.MeshFaceMaterial(materialArray);
var sphere = new THREE.Mesh( geometry, material );
scene.add( sphere );

Would the same approach work for videos? If I wanted to display six videos on a sphere, should I load the video texture onto the six faces of a cube and then expand it into a sphere?

EDIT:

Here's the code snippet I have:

<!DOCTYPE html>
<html lang="en">
    <head>
    <title>three.js webgl - equirectangular video panorama</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <style>
        body {
            background-color: #000000;
            margin: 0px;
            overflow: hidden;
        }

        #info {
            position: absolute;
            top: 0px; width: 100%;
            color: #ffffff;
            padding: 5px;
            font-family:Monospace;
            font-size:13px;
            font-weight: bold;
            text-align:center;
        }

        a {
            color: #ffffff;
        }
    </style>
</head>
<body>

    <div id="container"></div>

    <script src="three.js"></script>

    <script>

        // Code continues...

    </script>
</body>

However, unfortunately, it doesn't seem to work as expected. When hosted online, all I see is a black screen. Can you please assist me in figuring out what could be causing this issue?

Answer №1

Through my recent exploration into 360 videos using threejs (which I am still learning about), it seems that the black screen issue could potentially stem from the video resolution being too high overall. If each video is in 4k resolution, you may essentially be trying to display a massive 24k resolution video. In my experience, problems tend to arise after reaching around 5.7k resolution, even on top-tier hardware and with network speeds exceeding 100 mbps.

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

What is the best way to align a jqdatetimeinput jqwidget in the vertical center?

Facing some alignment issues here. My goal is to perfectly center my datetimeinput widget from jqWidget. I aim to have the datetimeinput vertically centered on the page, and directly underneath it, a centered date range based on the selected datetimeinput. ...

Bootstrap table showing message "loading in progress, please be patient"

I'm having an issue trying to load data from an API into a bootstrapTable but it seems to be stuck on "loading..". Can anyone help me figure out what's wrong with my code? Thank you in advance for your assistance! <table id="table" ...

I encountered a problem with nesting .then functions where I was unable to properly send the response back to the

When working with express.js I have two APIs that serve the same type of data, and I am building a simple application that should first use the primary API. If an error occurs, then it should fall back to the second one. The approach I attempted involves ...

Using AngularJS variables within JavaScript code

This is my introduction to using AngularJS. The code snippet below displays the desired output: <a href="http://www.example.com/xyz/{{life.animal}}/" target="_blank">Hello </a> Upon clicking, it redirects to: http://www.example.com/xyz/c ...

JavaScript Class Emit Signal for establishing a sequence of interconnected events

My Vue project includes a JavaScript class specifically for mobile devices. I'm looking to have this class emit a signal once the property 'hasEnded' is set to True for my object. How can I achieve this and chain together other events based ...

Vuejs Error: The 'in' operator cannot be used for searching

I am facing an issue with my form and VueJS. Upon clicking the "Login" button, I intend to change the text on the button. However, instead of achieving this, I encounter an error stating 'cannot use 'in''. Below is the HTML code snippet ...

The function failed to obtain JSON data from the generated URL

I want to fetch the latest local weather details using a weather API. Below is the code I am working with: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> function generateUrl() { var ap ...

Concerns arise with the swal destroy functionality

I have a working code for the Swal function, but when I click cancel without entering any information, it still triggers the AJAX call, which is not desired. $(document).on('click','.addon',function() { Swal.fire({ title: &apo ...

The element is anchored within a div, but its position is dependent on a JavaScript script

I am dealing with a situation where I have a div named "Main_Card" containing text and an icon. When the icon is clicked, it moves the "Main_Card" along with everything inside of it. The challenge arises when I need to set the icon's position as eithe ...

Transmit the Boolean value to the controller using ajax requests in asp.net.core with C# programming

Within the view section, there is a form that includes a checkbox input. <div class="checkbox"> <label class="">active</label> <div class="icheckbox_flat-green checked" style="position: relative;"> <input type="checkbox" id="A ...

Implementing a feature that allows users to initiate a download window in a node.js express application

I have a node.js + express application in development. A scenario I am facing involves creating an excel file on the server side and then serving it to the user for download, allowing them to choose their preferred directory. Once the file is downloaded, I ...

Firebase Authentication error code "auth/invalid-email" occurs when the email address provided is not in a valid format, triggering the message "The email address is

Currently, I am working on integrating Firebase login and registration functionality into my Angular and Ionic 4 application. Registration of user accounts and password retrieval are functioning properly as I can see the accounts in my Firebase console. Ho ...

Exploring the features of AngularJS, including ngTranscluded, angular.noop, and the differences between Inter

I have some doubts about certain concepts in AngularJS such as- Reference (The official documentation is a bit confusing on these topics.) When should we use the "ngTranscluded" directive? Under what circumstances would we need to create a function that ...

Completing online form text entries in WebView without the need for identifying elements

I am currently working on a project to automate filling out an online login form using local string variables. This is the progress I have made so far: web = (WebView) findViewById(R.id.webview); WebSettings webSettings = web.getSettings() ...

Pusher authentication issue: socket ID not defined

I am currently facing an issue while trying to establish a private channel for users to transmit data to my node.js server. Upon making the request, I encounter an error where pusher:subscription_error is returned with the error code 500. Upon checking my ...

The issue of "Container not being defined" in React is causing trouble

Trying to grasp the concepts of React, but encountering an error with 'Container' being undefined. Despite following all steps in the course, I can't seem to figure out the root cause of this issue. Below is a snippet from App.js: import Re ...

What is the best way to mimic a library using SinonJs?

I am dealing with a file named browser-launcher.ts import * as Browser from "@lib/browser"; class BrowserLauncher { launch(options) { browser = Browser(options); } } export const browserLauncher = new BrowserLauncher() W ...

Utilizing react.js and passing props as parameters in recursive functions

When using recursion, I encountered an issue where I am unable to pass the props parameter: class App extends React.Component { constructor(props) { super(props); this.state = { visible: this.props.root, a:this.props.a }; } toggle(){ thi ...

Modify the form's action attribute when submitted

I am trying to create a form with multiple buttons that will change the action and target properties when a specific button is clicked. Below is my code snippet: <div id="root"> <form :action="form.action" ref="form" :target="form.target"&g ...

What is the purpose of including the 'return false;' statement in a submit event?

I am curious about the purpose of the return false; statement within this Pig-Latin translator. When I remove it, I notice that the translation automatically disappears without any delay, but I'm uncertain about the underlying mechanism causing this b ...