Adjusting the surface appearance in three.js

I recently created a texture using three.js, but I'm looking to adjust the angle of the texture. Refer to the images below for more context. Essentially, I want to tilt the current output slightly downwards so that the green surface is parallel to the ground and more of the sky is visible.

I've experimented with camera settings, as well as the position and rotation of the texture, but haven't achieved the desired outcome.

Current Output https://i.sstatic.net/gHowA.png

Desired Output https://i.sstatic.net/HQuO4.png

You can access my code on jsbin

Code Snippet:


<!-- HTML -->
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Head elements -->
</head>
<body>
    <div id="ThreeJS"></div>
</body>
<script>
   // JavaScript code
</script>
</html>

CSS Styles:


/* CSS styles */
html, body {
    /* Styling rules */
}

.row {
    /* Additional styling */
}

.button {
    /* Button styles */
}

Image Source:

Answer №1

To achieve the desired perspective, consider assigning a target to your controls object, which defaults to (0, 0, 0). Adjusting the y-value will give you the perspective you're looking for:

controls = new THREE.OrbitControls( camera, renderer.domElement );
controls.target.set( 0, 10, 0 );

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

The renderer cannot process multiple calls simultaneously

Over the past couple of months, I've delved into the world of three.js and JavaScript, focusing on shaders and even exploring procedural planet generation. The challenge of working with non-euclidean geometries like spherical shapes intrigues me, espe ...

Issue with form control validation within a form array not functioning as expected

I am working with a form array that contains form controls. Here is the snippet of HTML code: <div class="container"> <ng-container formArrayName="positions"> < ...

Activate Click, or Pop-up Box

I've been attempting to log in to the Udemy site using JavaScript, but I'm having trouble triggering the click action on the "log in" link. Unfortunately, the .click() method doesn't seem to be working when I try to select the element. The l ...

Implementing a Dropdown Menu Within a React Form

I am currently working on setting up a reservation system for rooms. I want to include 2-4 different room types and incorporate a dropdown menu instead of manual input. I am using the guidance provided here. I attempted to use <Form.Select...>, but i ...

Is the purpose of express.json() to identify the Request Object as a JSON Object?

app.js const express = require('express'); const cookieParser = require('cookie-parser'); const session = require('express-session'); const helloRouter = require('./routes/hello'); const app = express(); app.set(& ...

Manipulate the display of multiple elements in jQuery by utilizing data attributes

Hello there, I am currently using jQuery to filter a list of elements on a webpage based on a HTML select containing client IDs. The HTML elements have a data attribute called data-client. Unfortunately, the code I have written is causing all elements to b ...

Adjusting the size of a DIV based on the number of characters entered in the text field

I have created a text box that dynamically prints out the entered text in a div below as it is typed. The current setup allows for 24 characters to be displayed in the DIV before text wrapping occurs. My goal is to double the height of the DIV for every ad ...

Presenting information extracted from the Meteor 1.0 framework

At the beginning of my Meteor application, I import data from a JSON file using the following code: 13 if (Meteor.isServer) { 14 15 //startup 16 Meteor.startup(function () { 17 if(Plugins.find().count() === 0) { 18 var plugins_data = J ...

Developing Modules in NodeJS using Constructors or Object Literals

I am currently developing a nodejs application that needs to communicate with various network resources, such as cache services and databases. To achieve this functionality, I have created a module imported through the require statement, which allows the a ...

Integrate birthday validation using the validate.js library in a React application

After reading the article linked here, I incorporated it into my app. My next step is to include a date validation to ensure that the person is over 18 years old. I am currently struggling with understanding where and how to incorporate the parse and for ...

Javascript String-Converted Dates Display Incorrect Time

I've come across a strange issue while trying to create new data in JavaScript from a string. The format of my string is as follows: 2015-12-04T01:42:13. Here's the code I'm using: date = new Date(2015-12-04T01:42:13) console.log(date); A ...

Displaying a pop-up message from the server to the client using Express.js and React.js

I have successfully created a CRUD application and now I am looking to implement a feature on the frontend to notify the user if the entered FirstName already exists. Currently, I am able to log a message using console.log(), but I want to display this mes ...

Having trouble initiating the webpack development server

As a newcomer to ES6, I decided to set up my development environment by following a guide for beginners. After completing all the steps as instructed, I reached the point of installing the webpack development server. Upon entering the command npm run bui ...

Using Async/Await for Timers within a Loop in Javascript

Currently developing a "Timeblocks" style application for university. The main concept involves having a list of subtasks, each with a specified time limit. The goal is to iterate through these tasks, utilizing a timer to countdown the allocated time and t ...

Using React.js - Discover the best way to incorporate a function within a child component to unmount a different child component from the same parent, and then mount a new component in its place

Consider this scenario: import React, { Component } from 'react'; import BodyContent from './BodyContent'; import BottomOne from './BottomOne'; import BottomTwo from './BottomTwo'; class App extends Component { re ...

The ASP.NET Core MVC controller encounters a null input parameter when called by an ajax request

Here is the scenario involving an ajax call: ... $("#testBtn").click(function (e) { e.preventDefault(); $.ajax({ url: "/profile/GuestList", data: {"keytype": "1"}, method: "POST&q ...

How can I toggle input disablement in Bootstrap depending on switch selection?

I have been exploring the Bootstrap 5 documentation in search of a way to disable other input fields when a toggle switch input is set to 'off'. The parent element for this scenario is #member_form, and the switch itself is identified as 'to ...

Is there a way to cross-reference a city obtained from geolocation with the cities stored in my database, and if a match is found, send the corresponding ID

Here's the script I'm currently working with: <script type="text/javascript"> search = new Vue({ el: '#offers', data: { data: [], authType: '{{uid}}', key : '1', wi ...

When attempting to utilize a global variable in a POST request, it may be found to

My dilemma is that I can successfully access the global variable in other requests such as 'GET', but it becomes undefined when used in a 'POST' request. var dirName; app.post("/addFace", function (req, res) { //create directory con ...

Unable to send multiple onChange AJAX requests

Why do I keep getting the error Notice: Undefined index: provinsi when trying to retrieve values from tahun and provinsi using this code? If I remove provinsi from the code and only use tahun, I am able to successfully fetch data from my database. func ...