What is the solution for repairing the thin wireframe of a Three.js Cube?

The issue: The Three.js 3D cube I designed with a wireframe or outline mode looks fine on desktop and tablet devices, but when viewed on mobile, the wireframe becomes too thin to be practical. I need to maintain the same wireframe thickness for mobile as it appears on desktop and tablet.

Examples: Below are screenshots illustrating the problem:

  • Desktop (simulated iPhone 6 size in Chrome browser) -

https://i.sstatic.net/8N5Nn.png

  • Mobile (actual iPhone 6 size in iOS Chrome browser) -

https://i.sstatic.net/dWMLt.png

Current code snippet:

var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );

var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );

// Make the site responsive
window.addEventListener('resize', function(){
  var width = window.innerWidth; 
  var height = window.innerHeight;

  renderer.setSize(width, height);
  camera.aspect = width / height;
  camera.updateProjectionMatrix();
});

var geometry = new THREE.BoxGeometry( 1.5, 1.5, 1.5 );
var material = new THREE.MeshBasicMaterial( { color: 0x00ff00, wireframe: true } );
var cube = new THREE.Mesh( geometry, material );

scene.add( cube );

camera.position.z = 5;

function render() {
  requestAnimationFrame( render );

  cube.rotation.x += 0.025;
  cube.rotation.y += 0.025;

  renderer.render( scene, camera );
}
render();
html,body { 
  margin: 0;
  overflow: hidden;
}
canvas { 
  width: 100%; 
  height: 100%;
  background-color: black;
}
h1 {
  font-family: 'Maven Pro', sans-serif;
  font-size: 3em;
}

p {
  font-family: 'Lato', sans-serif;
  font-size: 1em;
}
#textthing {
  position: absolute;
  margin-bottom: 60px;
  color: #00FF00;
  /**height: 90%;**/
  width:100%;
  text-align: center;
  bottom: 0;
}
   
<link href='https://fonts.googleapis.com/css?family=Maven+Pro' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Lato:400,300' rel='stylesheet' type='text/css'> 

<div id="textthing">
  <h1>weeflix LLC</h1>
  <!--<h2>Coming soon.</h2>-->
  <p>Jake Schnieder  ||  Thomas Bisnitsz</p>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r77/three.min.js"></script>


 

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

Exploring unconventional shapes using THREE JS

Currently, my task involves loading three different types of geometry (cubes, lines, and points) from CSV files into a scene. I also need to add a camera and lights to visualize the geometry effectively. While loading cubes seems straightforward, I'm ...

Validation of Date in Angular 5 (with specified minimum and maximum dates)

Struggling to find a simple solution for this issue, I have a date input like the following: <input [(ngModel)]="toolDate" type="text" class="tool_input tool_input__date"> To control the input and restrict it to only accept dates, I am using . In m ...

Expanding the size of one div causes the surrounding divs to shift positions

I am currently working on creating a row of divs that expand when hovered over by the mouse. I have managed to achieve this functionality, but now I want the expanding div to cover its neighboring divs partially, without affecting their sizes or moving the ...

Having difficulty altering the color of an element in Viewer

Currently, I am conducting a PoC and experimenting with changing the color of a selected element to red. Despite creating a class as shown below, I am facing issues where the elements do not change color when selected. I have attempted various examples fro ...

Placing a Plane Geometry button above a row of cubes without affecting its position on the z-axis - a guide

I'm facing an issue with a grid of cubes where I need to display a button when hovering over a row. To achieve this, I have created the button using a plane geometry. However, when trying to position it at the top of a specific row, it gets displaced ...

Start and Pause PHP Execution on Demand

In order to pause the execution of PHP/HTML code and resume it by clicking on a "continue" button, here is an example: <?php echo "Hello"; // I would like the PHP code to halt after printing "Hello" here. // Additionally, I would like to include a "C ...

What is the process for making a button that only consists of text?

Is there a way to design a button that displays text like a hyperlink, but still maintains the <button> characteristics? ...

Searching by object id from the front-end: A step-by-step guide

Within my collection of meals, there is a specific document I am working with: # Meals collection { name: "burger", tag: ObjectId(63d6bb22972f5f2fa97f1506), } Now, as I navigate through my React application, I find myself needing to send a ...

Retrieving the width and height of a DIV element using Javascript

Currently, I am attempting to retrieve the width and height of a div element as it is being changed by the user and then pass that data to another page. However, I am encountering difficulties in obtaining the width and height values. <script> $(fun ...

Dragging additional events into FullCalendar is disabled after applying a filter to external events

I am encountering an issue while attempting to drag events from the external events box to the fullcalendar. To replicate the problem, you can visit this CodePen: Initially, dragging an external event into the calendar works smoothly. However, after appl ...

Tips for positioning icons inserted using the :before method

Is there a way to center align an icon added using the :before method? Below is the current code snippet: <div class="button submit"> <a class="submit check_car_search" href="#" >Some Text</a> </div> CSS: .button a{ backgr ...

Using the jquery stop() function will halt any ongoing hover effects from being applied

I am currently experiencing a problem with the code found on http://jsfiddle.net/eSbps/. This specific code pertains to a menu system that reveals second levels when hovering over the top levels, using slideDown('slow'). To prevent queuing effe ...

jQuery mobile : accessibility helper for hidden elements

Within my HTML structure: <div data-role="fieldcontain" id="containdiv" class="no-field-separator"> <label for="field1" class="ui-hidden-accessible">To</label> <input type="search" name="field1" id="field1" autocorrect="off" a ...

The smooth scrolling feature of jQuery does not function properly when combined with the Bootstrap 4 Navbar

Here is the code I have for the navigation bar on a website I am currently working on: <body data-spy="scroll" data-target="#navbar" data-offset="20"> <!-- navbar --> <div id="home"> <div id="navbar"> <nav class="n ...

The onchange event does not seem to be functioning as expected in a dropdown menu that was dynamically added from a separate

Is there a way to display a list of tables from a database in a dropdown menu and allow users to select a table name? When a user selects a table name, I would like to show all the data associated with that table. The HTML file structure is as follows: & ...

JQuery Slider's Hidden Feature: Functioning Perfectly Despite Being Invisible

Having an issue with a jQuery slider on my local HTML page. The sliders are not showing up as intended. I want it to display like this example: http://jsfiddle.net/RwfFH/143/ HTML <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery ...

What is the best way to ensure that a div takes up as much vertical space as possible within its

Check out my design at https://jsfiddle.net/49hsztuh/ Take a look at the code snippet below: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <link rel="stylesheet" type="text/c ...

Error: The function `res.status` is unsupported

I've been working on a function to allow uploading images to imgur through my express API (nodejs), but I'm running into an issue when calling a function that returns a promise: TypeError: res.status is not a function at uploadpicture.then T ...

Using Vue.js to send user input data to a different page and trigger a method for submission

I am seeking assistance with my first question and hope to receive your support. In my setup, I have a catalogue page that includes a keyword search function and a main page with a search bar. My objective is to automatically redirect any submission from ...

Issue encountered when attempting to use array.sort on values exceeding 1000

When I use the .sort() method on my firstArr example, it functions correctly. However, when I apply the .sort() method to secondArr, which contains values exceeding 1000, it malfunctions. I have attempted to locate information on any limitations of the . ...