Here's how you can use welding techniques to attach objects and incorporate fin-like structures in THREE

I am currently working on a project involving a rocket ship orbiting various planets. To achieve this, I have started by creating my own rocket ship object and am aiming to model it similarly to this design:

https://kyleagnew.files.wordpress.com/2018/02/lowpolyrocket5.jpg

Here is the current model that I have developed: https://jsfiddle.net/pfya1sjm/4/

As you can see from my model, it consists of multiple objects aligned along the y-axis, resulting in visible lines between them and an overall lack of smoothness. Is there a way to either avoid this or merge the objects together for a seamless appearance?

Additionally, I am looking to create fin-like structures protruding from the bottom of the rocket, as shown in the example I am trying to replicate.

// once everything is loaded, we run our Three.js stuff.
                $(function() {

                    var stats = initStats();

                    // create a scene, that will hold all our elements such as objects, cameras and lights.
                    var scene = new THREE.Scene();
                    
                    ...
                    
                        GameLoop();
body {
          margin: 0;
        }
<script type="text/javascript" src="https://threejs.org/build/three.js"></script>
        <script type="text/javascript" src="https://threejs.org/examples/js/controls/OrbitControls.js"></script>
        <script type="text/javascript" src="https://threejs.org/examples/js/libs/stats.min.js"></script>
        <script type="text/javascript" src="https://threejs.org/examples/js/libs/dat.gui.min.js"></script>

        <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>

Answer №1

The reason the edges between different body sections look sharp is due to the fact that the normals of the vertices don't match and blend together seamlessly.

THREE.MeshPhongMaterial relies on vertex normals to determine how edges should be blended. If the normals at an edge are consistent, the edges will appear smooth. However, if the normals are pointing in different directions, the edges will look distinct and hard.

You have several options available to address this issue:

  1. Adjust the geometry so that connected edges share the same normal vector value for their paired vertices.

  2. Manually combine geometries into a single object and reconcile any differing normals to ensure they align.

  3. Create a custom geometry definition using THREE.Geometry or THREE.BufferGeometry.

I highly recommend exploring option 3, especially when defining intricate features like "fins". While you could attempt to manipulate pre-made mesh shapes to achieve your desired effect, crafting a custom geometry is likely to be much more straightforward.

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

Traverse through an object in ReactJS

Having trouble iterating over an object in my ReactJS project and facing some content display issues. Check out this fiddle for reference - http://jsfiddle.net/8e039Ltw/ Here's the ReactJS code snippet:- class TodoApp extends React.Component { ...

Alternative for document.ready in AngularJS when outside of AngularJS

I am currently developing a small Chrome extension that will interact with an Angular website. I have managed to successfully detect full page reloads using $(document).ready(), but I am facing issues when it comes to detecting page changes triggered by ng ...

Querying the Collection for document counts is failing to display any data

Hey there, I am currently in the process of developing a social media app with the MEAN stack. One of the key features I'm working on is the ability to list the users that a person is following. However, I have encountered an issue as Collections.Find ...

Creating a stylish navigation bar with custom components using Material UI and React

I've been experimenting with the BottomNavigation component from Material UI, but instead of using labels and text, I want to incorporate custom-made ImageButton components. Here's the code snippet from Material UI: import React from 'rea ...

When attempting to import my JSX file into page.js, I continue to encounter the error "module not found." How can I troubleshoot and resolve this issue in Visual Studio Code

I recently created a new file called mysec.jsx in the components folder of src. I then used the export function to properly export it. However, when I tried to import this file in page.js using the import function, I encountered an error message that said: ...

The transformation of a class-based component into a functional one is proving to be ineffective

I am attempting to transform my class-based component into a functional one, but I am struggling with passing two parameters in one onClick function without relying on set state. Additionally, I want to avoid creating multiple extra functions as it would i ...

Fetching from the same origin results in a null comparison issue due to HTTP CORS restrictions

Encountering an issue where a simple same-origin fetch("fetch.xml") call fails, resulting in a console error message Access to fetch at 'http://127.0.0.1:8000/fetch.xml' from origin 'null' has been blocked by CORS policy: Th ...

The value of the checked input with the name `nameofinput` is currently not defined

I'm having trouble passing the input value to another page. $( this ).attr( "href", '?module=module_progress_report&Subject='+ $('input[name=subject]:checked').val()+ '&Centre_Selected_ID='+ encodeURIComponen ...

Intermittent connectivity issues causing clients to miss messages from Nodejs server

Currently, I am in the process of setting up a basic node application where visitors can interact with a letter counter on the site. The idea is that every time someone presses a letter, the counter will increase and all users will be able to see it go up ...

A bounding box aligned with the camera's perspective

One issue I am grappling with is determining the camera's position, considering a given lookAt vector when the camera is not aligned with the z-axis. The goal is to ensure that the camera captures all objects within its field of view and aspect ratio. ...

Ways to specify a setter for a current object property in JavaScript

Looking to define a setter for an existing object property in JavaScript ES6? Currently, the value is directly assigned as true, but I'm interested in achieving the same using a setter. Here's a snippet of HTML: <form #Form="ngForm" novalida ...

Retrieve the HTML structure from an AJAX response

I'm working on an Ajax call in my code: callAjaxController: function(){ var url = Routing.generate('ajax_price'); $.ajax({ type: "GET", url: url, cache: false, success: funct ...

When using the POST method with npm http-server, an error 405 is thrown

I'm attempting to send an Ajax request to execute a php file on a local http server. However, the browser console shows Error 405: method not allowed. Even after trying solutions from similar questions and enabling CORS on the http-server, I still ca ...

Troubleshooting: Mongoose Array Object Order Modification Issue

Imagine we have a person named Michael who lists his favoriteFruits as [ { name: 'Apple'}, {name: 'Banana'} ] The challenge at hand is to change the order of his favorite fruits. In other words, we want to transform it from: [ { name ...

Unable to submit form in Node.js with Express

I am just starting out with node.js and I need help with a sample form to insert values into a database. Below is the code snippet for my test page: <form action="/create" method="POST" class="form-horizontal" enctype="application/x-www-form-urlencode ...

CKFinder Error: Unable to find definition for t.event.special.swipe

Upon using CKFinder 3.2.0 with Firefox 44.0, I encountered the following error message. Interestingly, this issue is exclusive to Firefox while Chrome works perfectly fine. Any insights on what could be causing this problem and how it can be resolved? Ty ...

Embedding a Three.js object within a div element that has disabled zoom functionality and prevents scrolling or zooming within

Recently, I started learning about three.js and currently find myself in need of some assistance. My goal is to set up my scene within a div element rather than the entire document without any zooming while still allowing the user to scroll using the mouse ...

Unable to store user data in the MongoDB Database

I'm currently facing an issue while trying to store user information in my MongoDB database. Everything was working fine until I implemented hashing on the passwords using bcrypt. After implementing password hashing, I am encountering difficulties in ...

Showing data from a Node.js Express application in a Jade template file

I am encountering an issue with my simple jade page where not all variables passed from the javascript route are displaying correctly. I have attempted to implement the solution described in this answer, but it seems to be ineffective in my case. My goal i ...

Developing a custom camera system for a top-down RPG game using Javascript Canvas

What specific question do I have to ask now? My goal is to implement a "viewport" camera effect that will track the player without moving the background I am integrating websocket support and planning to render additional characters on the map - movement ...