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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:31:31+00:00 2026-06-12T04:31:31+00:00

I have a temp variable a THREE.Veector3 which I pass into the creation of

  • 0

I have a temp variable a THREE.Veector3 which I pass into the creation of an object

object[i] = new Object(new THREE.Vector3(0,0,0));

In the class Object I have a variable texture which I set to the new THREE.Vector3 called pos

function Object(pos){
    this.texture = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map:
    THREE.ImageUtils.loadTexture( '../img/img.png' ) } ) );

    this.texture.position = pos;

    this.texture.rotation.x = 0;
    this.texture.rotation.y = 1.57;
    this.texture.rotation.z = 1.57;

    this.texture.scale.x = 100;
    this.texture.scale.y = 50;
    this.texture.scale.z = 100;

    this.texture.position.y = 1000;
}

The problem I’m having is that I want to pass pos into another object created inside this Object.

object2 = new Object2(pos);

However pos has been modified to have the y at 1000. I’m not quite sure why this is happening I read some guides on passing variables but I’m still a bit confused on how the pos variable is modified. Any help would be much appreciated.

  • 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-12T04:31:32+00:00Added an answer on June 12, 2026 at 4:31 am

    Just change your object to always take a clone of the position

    function Object(pos){
        this.texture = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map:
        THREE.ImageUtils.loadTexture( '../img/img.png' ) } ) );
    
        this.texture.position = pos.clone();
    
        this.texture.rotation.x = 0;
        this.texture.rotation.y = 1.57;
        this.texture.rotation.z = 1.57;
    
        this.texture.scale.x = 100;
        this.texture.scale.y = 50;
        this.texture.scale.z = 100;
    
        this.texture.position.y = 1000;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array stored in a variable temp which looks like this: temp.inspect
I have a variable inside my php file, which I want to pass to
I have a Node class that has an 'element' slot which contains a list
I have a temp table variable that I need to update with something sort
I have a question regarding this keyword. I have a class called BiPoly, which
First off we have the almighty code! List nodes = new List(); TreeNode Temp
I have a list of JLabels that I am insterting into my JPanel: avatarGridPanel.add(new
I have defined three variables a,b,c before a while loop, then compute a new
In my CI controllers I have these three functions: function _temp ($view,$data=) { $this->load->view('temp/nm-header',$data);
I am working on a python code I have used temp variable because If

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.