Jump to content

ArcCamera jumping around


Recommended Posts

When using chains of parent objects, especially with large distances, the camera jumps all over the place:


Problem kicks in just after a distance of 10,000,000.

This could perhaps be solved by utilising https://github.com/MikeMcl/bignumber.js/

Edit: Problem occurs when there's a large differential between the size and distance when using parent objects:


Link to comment
Share on other sites

As a workaround to this problem, I guess I'll use the currently viewed object as the origin, and re-compute the position of other objects, using the current as an offset. (Not ideal since it'll be calculation heavy).

Another workaround would be to play with sizes and distances until I find something that works, although taking this route will likely end up giving me problems in the future.

Thank you for your help)

Edit: Relevant information here: http://stackoverflow.com/questions/14761595/three-js-objects-shimmering-at-large-distances

Link to comment
Share on other sites

So it was very simple to make the change:

// Each object has it's own JS position vector
// Here we assign new a mesh position based on a subtraction of 
// this mesh's position and the new origin's position

// Save this object for use inside Object.each()
var that = this;

// Offset each of the meshes which belong to this object by an arbitrary position
Object.each(this.meshes, function(mesh) {
  mesh.position = that.position.subtract(newOrigin.position);

Using mootools for Object.each

Link to comment
Share on other sites

whoa whoa whoa, can you go back over this really quick? something is not right there is no reason for the camera to jitter given your explanation and there should be no work around.  Ill take a look at the playground you posted and see what I can find

Link to comment
Share on other sites

ohh ok I got it... why is your camera maxZ so high?

there is no point for that, set it to something reasonable, like 100 and scale your scene from there to do the ratio or size that you want.

    camera.maxZ = 10000000000000; is never going to work, in any engine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...