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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:28:44+00:00 2026-06-04T19:28:44+00:00

I have a webgl application with threejs. It uses TrackballControls to control the camera.

  • 0

I have a webgl application with threejs. It uses TrackballControls to control the camera. I have a button which I want to use to reset the scene, so, the camera should go to the initial state. I currently have this (jquery):

$('#reset').click(function() {
    camera.position.set(0, 0 , 400);
    camera.rotation.set(0, 0, 0);
});

But strangely, when I log the position and rotation, they are not as they should be and the camera is not at the correct place. What am I doing wrong, is there a better way to do this?

  • 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-04T19:28:47+00:00Added an answer on June 4, 2026 at 7:28 pm

    Until the bug is fixed (see comment on Yuval Adam’s answer), a working (though dirty) solution is to remove the camera from the scene, then to create a new one, add controls to it and add the new camera to the scene.

    Update:
    TrackballControls now has a reset() method. Call this after the tween completes and all is well! (https://github.com/mrdoob/three.js/commit/4f800f61809560c434bbbf12e76c3931e8e8c0fb)

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

Sidebar

Related Questions

I am trying to make a simple 3D application in WebGl, in which every
I'm finishing up a drawing application that uses OpenGL ES 2.0 (WebGL) and JS.
I have android app which works fine. And now I want to add some
I have a WebGL shader which compiles perceptually immediately (Chrome on Windows 7) when
I have written some WebGL code, actually I am playing with the examples that
Have a simple one-off tasks which needs a progress bar. OpenSSL has a useful
I want a unit-test framework for JavaScript which runs in the browser . Not
I have created an OOP environment for WebGL so I can easily create all
I want to start with my webGL project and minimal require is my graphic
I have seen several applications to profile DirectX and OpenGL applications, which measure Graphic

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.