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

  • Home
  • SEARCH
  • 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 8885847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:24:42+00:00 2026-06-14T21:24:42+00:00

I am trying the following code: var loader = new THREE.JSONLoader(); var onGeometry =

  • 0

I am trying the following code:

var loader = new THREE.JSONLoader();
var onGeometry = function(geom) {
var tooth = new THREE.Mesh( geom, new THREE.MeshFaceMaterial());
tooth.position.set(xpos,ypos,0);
teeth.push(tooth);
scene.add(tooth);
xpos+=10;
};
loader.load('js/JsonModels/teeth1.js', onGeometry);
loader.load('js/JsonModels/tooth2.js', onGeometry);
loader.load('js/JsonModels/teeth1.js', onGeometry);
loader.load('js/JsonModels/tooth2.js', onGeometry);
loader.load('js/JsonModels/teeth1.js', onGeometry);
loader.load('js/JsonModels/tooth2.js', onGeometry);

The models does not appear on screen in the order in which I load them which in my case is necessary since I am positioning objects depending on the order in which I load them. Same was the issue when I used OBJLoader and used its callback to add the objects in to scene and store them in array.
So, how can I achieve this, How can I display multiple object on the screen positions that I can specify.
Any Suggestion?

  • 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-14T21:24:43+00:00Added an answer on June 14, 2026 at 9:24 pm

    Create a callback factory for which you can pass the desired position and have it saved in a closure:

    function getGeomHandler(posx) {
      return function(geom) {
        var tooth = new THREE.Mesh(geom, new THREE.MeshFaceMaterial());
        tooth.position.set(posx, posy, 0);
        teeth.push(tooth);
        scene.add(tooth);
      };
    }
    var posx = 123;
    var loader = new THREE.JSONLoader();
    loader.load('js/JsonModels/teeth1.js', getGeomHandler(posx)); posx += 10;
    loader.load('js/JsonModels/tooth2.js', getGeomHandler(posx)); posx += 10;
    loader.load('js/JsonModels/teeth1.js', getGeomHandler(posx)); posx += 10;
    loader.load('js/JsonModels/tooth2.js', getGeomHandler(posx)); posx += 10;
    loader.load('js/JsonModels/teeth1.js', getGeomHandler(posx)); posx += 10;
    loader.load('js/JsonModels/tooth2.js', getGeomHandler(posx)); posx += 10;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying the following code: var loader = new THREE.OBJLoader(); var xpos =
I'm trying to use the following code: $('#clicker').click(function(){ var canvasRef = $('<canvas id=project_canvas/>'); var
I am trying to adapt the following code $(#artistSearch).submit(function (event) { event.preventDefault(); var form
when I trying to run following code. var result = from c in db.brand
I am trying to get a webpage to parse using the following code. <var-def
I am trying to replace a CSS style in the following code: var theHTML
I have the following code: var myModule = (function($) { // Insert code here
I currently am trying the following code: $sql = $db->query(select id,username,fullname from userss ORDER
I am trying the following code in eclipse: public class A { List<Integer> intList
I am trying the following code to AutoComplete contact details as the user types

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.