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 7996499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:43:26+00:00 2026-06-04T14:43:26+00:00

I am trying to learn the correct way to manipulate objects in world space.

  • 0

I am trying to learn the correct way to manipulate objects in world space. As a test I have created a cube and I am drawing some lines from an arbitrary vector to each vertex on the cube.

If I don’t change the cube in any way then the lines hit the vertices nicely:

correct

but if I rotate the cube, then the lines no longer match the vertices:

wrong

Obviously I know I could rotate the line by the same amount as I am rotating the cube, but I know I should be manipulating matrices or vectors to do this.

Can anyone explain how I should be approaching common issues like this, without needing to rotate both objects.

For convenience I have a jsfiddle to play with

  • 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-04T14:43:27+00:00Added an answer on June 4, 2026 at 2:43 pm

    If you want the lines to rotate with the code you just need to add the line to the cube instead of to the scene:

    // scene.add(line);
    cube.add(line);
    

    However, if what you want is to keep the origin of the lines at the same position and update the end of the lines instead.

    cube.updateMatrixWorld(); // make sure that cube.matrixWorld is updated.
    
    for(var i = 0; i < 8 ;i++){
       var vertex = cube.matrixWorld.multiplyVector3(cube.geometry.vertices[i].clone());
       lineGeometry.vertices.push(vertex);
       lineGeometry.vertices.push(lineStart); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to learn a bit about c++ and have run in to some
I'm trying to learn python and have encountered some strange behaviour. I am experimenting
I am just started learning WPF, and trying to learn the correct way to
Trying to learn about php's arrays today. I have a set of arrays like
I'm trying to learn about shift-reduce parsing. Suppose we have the following grammar, using
I'm trying to learn the Qt framework. My QStateMachine code does the correct thing
I am trying to learn a little c++ and I have a silly question.
I'm trying to learn some smalltalk programming.... I'm trying to create a list of
I'm learning javascript, and in the way I'm trying to learn more about jQuery.
I created a small vb.net console app in visual studio 2008 trying to learn

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.