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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:01:04+00:00 2026-06-11T19:01:04+00:00

Sorry for asking what is probably a very simple noob question. I have a

  • 0

Sorry for asking what is probably a very simple noob question.

I have a view, which creates geometries within a Three.js renderer – the view renders successfully the first time around. However, subsequent calls to the render function fail with an unknown reference error.

I am trying to store a reference to the rendered geometry within the view rather than the model as the model is shared between multiple browsers (and indeed the server) – using Backboneio.js

The view looks like this:

StarSystem.hudContact = BackboneIO.View.extend({
  el: '',
  model: '',
  initialize: function(options) {
    var material = new THREE.LineBasicMaterial({
      color: 0xFFFFFF,
    });

    var geometry = new THREE.Geometry();
    geometry.vertices.push(new THREE.Vector3(0, 0, 0));
    geometry.vertices.push(new THREE.Vector3(0, 0, ((camera[0].position.z - this.model.get('zPos')) / 10000)));

    var line = new THREE.Line(geometry, material);
    line.position.x = ((camera[0].position.x - this.model.get('xPos')) / 10000);
    line.position.y = ((camera[0].position.y - this.model.get('yPos')) / 10000);
    line.position.z = 0;
    line.Name = this.model.get('Name');

    this._hudLine = hudScene.add(line);
    this.model.bind('update', this.render, this);
  },
  render: function(){
  console.log(this._sceneLine.position.x);
    this._hudLine.position.x = ((camera[0].position.x - this.model.get('xPos')) / 10000);
    this._hudLine.position.y = ((camera[0].position.y - this.model.get('yPos')) / 10000);
    this._hudLine.position.z = 0;

  }
});

So, as can be seen, I am trying to store a reference to the line (line) in this._hudLine – which is known on the first render (during the initialize call), but not thereafter (in the render call).

Any direction on how to handle this without having to rely on a global array or storing information within the model would be greatly appreciated…

Thanks!

  • 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-11T19:01:05+00:00Added an answer on June 11, 2026 at 7:01 pm

    This was solved with reference to the following article:

    Private and public variables to a backbone view

    However, I think the fundamental issue was with the original template which wrapped the view in a self executing function:

    (function () {
      //view stuff
    }).call(this);
    

    rather than:

    (function () {
      //view stuff
    })();
    

    A noob problem – many thanks for your help!

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

Sidebar

Related Questions

Sorry for asking a totally basic question, but if I have a synthesized property
First off, I'm sorry for asking such a simple question in such a sophisticated
Sorry for asking what seems like such an obvious question. I have an adapter
Sorry for asking very basic question. I would like to set OR condition in
Im very sorry for asking for this simple doubt.Im just started to android and
Sorry for asking silly question.. I have an array with class objects like: Class
Sorry for asking this simple question, but I seem not to find any answers.
Yeah, sorry about asking a stupid n00b question. So I have a C# program.
Sorry for asking probably a basic question, but I'm having a blackout. If I
Sorry for Asking very Basic Question. I am Doing SVN Export with the help

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.