Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9246367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:28:14+00:00 2026-06-18T09:28:14+00:00

I am working on a 3D mesh manipulator using this : http://leapmotion.com . So

  • 0

I am working on a 3D mesh manipulator using this : http://leapmotion.com. So far, I have been able manipulate the points just fine, by ‘grabbing’ and moving them, however I now want to be able to rotate the mesh and work on the opposite face. What I have done is add an extra object that is called ‘rotatable’ as Shown below:

scene=new THREE.Scene();
camera = new THREE.PerspectiveCamera(70,window.innerWidth/window.innerHeight,1,8000)
renderer=new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1, maxLights:5 } )


//This is the 'Mesh Scene'
rotatable = new THREE.Object3D()
scene.add(rotatable)


//Mesh we are altering
var material = new THREE.MeshNormalMaterial()
material.side=2

var geom = new THREE.SphereGeometry(200,10,10); 
var sphere = new THREE.Mesh(geom, material)

rotatable.add(sphere)

I am then trying to change the vertices of this sphere, but to do so I need to do a ‘collision test’ in order to see if the vertex is being ‘grabbed’ This involves check the vertex position and see if it coincides with one of your finger position (psuedoCode below)

if(finger.x == vertex.x && finger.y == vertex.y && finger.z == vertex.z){
    vertex.grabbed = true 
}

This works fine when the rotatable’s rotation is zero, however when it starts to rotate, the collision test will still be testing for the unrotated vertex position (which makes sense). My question is how to find the position of the vertex in its ‘scene / global’ position. The only way I can think of doing this so far is to calculate the rotation of the ‘rotatable’ and use this vector to calculate the new vertex position.

I know nothing about math, so this may not be the way to go, and even if it is I will have to struggle through it so hard that I won’t ever know if I’m just doing the math incorrectly, or this isn’t the way I should go about calculating it. Obviously I’m willing to go through this work, but just want to make sure this is the way to do it, rather then an other simpler method.

If there are any other questions about the code, please let me know, and Thanks in advance for your time!

Isaac

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:28:16+00:00Added an answer on June 18, 2026 at 9:28 am

    To get the world position of a vertex specified in local coordinates, apply the object’s world transform to the vertex like so:

    vertex.applyMatrix4( object.matrixWorld );
    

    (I am not familiar with leapmotion, so hopefully it does not impact this answer.)

    Tip: maxLights is no longer required. And it is best to avoid material.side = 2. Use material.side = THREE.DoubleSide instead.

    You can find the constants here: https://github.com/mrdoob/three.js/blob/master/src/Three.js

    three.js r.55

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working very hard on figuring this out and just can't understand
I'm working on creating a 3D landscape. So far I've got a mesh created
I'm working on a 3d game just for learning. I have a 3d world
I'm working on an interactive web application, currently set up on http://picselbocs.com/projects/goalcandy (user: demo@demo.com,
I'm working on an interactive web application, currently set up on http://picselbocs.com/projects/goalcandy (user: demo@demo.com,
Currently I have a working 3D mesh() plot. However, the vertical axis lends itself
I'm working with 3D mesh data, where I have lots of 3D triangles which
Soon i'll start working on a parallel version of a mesh refinement algorithm using
Currently working on a 3D media engine using C# and I have come across
I've been researching this problem I have and I can't seem to understand it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.