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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:19:02+00:00 2026-06-16T03:19:02+00:00

I have developed Panaroma using three.js Canvas Renderer API(), i observe broken and jarred

  • 0

I have developed Panaroma using three.js Canvas Renderer API(), i observe broken and jarred corners while rotating, how can i make my transition\output smooth?

enter image description here

enter image description here

Code:

panorama.html

<!doctype html>
<html>
<head>
<title>A Simple Panaroma</title>
<script src="three.js"></script>
<script src="panaroma.js"></script>
<link rel="stylesheet" href="panaroma.css"></link>
</head>
<body></body>
</html>

panaroma.css

html,body{
    margin:0px;
    padding:0px;
    border:0px;
    overflow:hidden;
    width:100%;
    height:100%;
}

panaroma.js

function Panorama() {
    var width = window.innerWidth,
        height = window.innerHeight; // Capture the width and height of window
    var scene = new THREE.Scene(); // Create a Scene
    var camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000); // Create a Camera width aspect ratio,zoomin and zoomout properties
    var renderer = new THREE.CanvasRenderer(); // Create a Canvas Renderer as we are using a canvas here
    var textureCanvas, materials, lon = 90,
        onMouseDownLon = 0,
        lat = 0,
        onMouseDownMouseX = 0,
        onMouseDownMouseY = 0,
        onMouseDownLat = 0,
        phi = 0,
        theta = 0,
        target = new THREE.Vector3(),
        isUserInteracting = false;

    //Set size of render

    renderer.setSize(width, height);


    addTextureCanvas();
    document.addEventListener('mousedown', onDocumentMouseDown, false);
    document.addEventListener('mousemove', onDocumentMouseMove, false);
    document.addEventListener('mouseup', onDocumentMouseUp, false);
    document.addEventListener('mousewheel', onDocumentMouseWheel, false);

    function addTextureCanvas() {
        //Create a Canvas Element
        textureCanvas = document.createElement('canvas');

        addMaterials();
    }

    function addMaterials() {
        materials = [



        loadTexture('http://img528.imageshack.us/img528/3751/righthf.jpg'), // Right
        loadTexture('http://img827.imageshack.us/img827/931/leftag.jpg'), // Left
        loadTexture('http://img94.imageshack.us/img94/4195/topfz.jpg'), // Top
        loadTexture('http://img856.imageshack.us/img856/1772/bottomi.jpg'), // Bottom
        loadTexture('http://img266.imageshack.us/img266/8257/backkmk.jpg'), // Back
        loadTexture('http://img189.imageshack.us/img189/3938/frontnmb.jpg') // Front


        ];
        addToScene();
    }

    function addToScene() {
        mesh = new THREE.Mesh(new THREE.CubeGeometry(100, 100, 100, 7, 7, 7), new THREE.MeshFaceMaterial(materials));
        scene.add(mesh);
        mesh.scale.x = -1.6;
        document.body.appendChild(renderer.domElement);
    }

    function loadTexture(path) {

        var texture = new THREE.Texture(textureCanvas);
        var material = new THREE.MeshBasicMaterial({
            map: texture,
            overdraw: true
        });

        var image = new Image();
        image.onload = function () {

            texture.needsUpdate = true;
            material.map.image = this;

            render();

        };
        image.src = path;

        return material;

    }

    function render() {

        lat = Math.max(-85, Math.min(85, lat));
        phi = (90 - lat) * Math.PI / 180;
        theta = lon * Math.PI / 180;

        target.x = Math.sin(phi) * Math.cos(theta);
        target.y = Math.cos(phi);
        target.z = Math.sin(phi) * Math.sin(theta);

        camera.lookAt(target);
        renderer.render(scene, camera);
    }

    function onDocumentMouseDown(event) {

        event.preventDefault();

        isUserInteracting = true;

        onPointerDownPointerX = event.clientX;
        onPointerDownPointerY = event.clientY;

        onPointerDownLon = lon;
        onPointerDownLat = lat;

    }

    function onDocumentMouseMove(event) {

        if (isUserInteracting) {

            lon = (onPointerDownPointerX - event.clientX) * 0.1 + onPointerDownLon;
            lat = (event.clientY - onPointerDownPointerY) * 0.1 + onPointerDownLat;
            render();

        }

    }

    function onDocumentMouseUp(event) {

        isUserInteracting = false;
        render();

    }

    function onDocumentMouseWheel(event) {

        camera.fov -= event.wheelDeltaY * 0.05;
        camera.updateProjectionMatrix();

        render();

    }
}

document.addEventListener("DOMContentLoaded", function () {
    new Panorama();
});

How to make output smooth? Any suggestion is highly 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-16T03:19:04+00:00Added an answer on June 16, 2026 at 3:19 am

    Increase the divisions on your CubeGeometry.

    mesh = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 16, 16, 16 ), new THREE.MeshFaceMaterial( materials ) );
    

    If you want to learn a lot about this issue, read this article.

    Tip: avoid this:

    mesh.scale.x = -1.6;
    

    Instead, keep the scale positive, and define your material like so:

    var material = new THREE.MeshBasicMaterial({
        map: texture,
        side: THREE.BackSide,
        overdraw: true
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed sample api as jar file. This jar file contains the code
I have developed a website using Razor (Microsoft WebMatrix) and now I want to
I have developed a small administration page for game servers which you can add/remove/edit
I have developed a Java server using Eclipse that accepts TCP socket connection from
I have developed a Facebook application using Flash as3. In this application when ever
Have developed a small Windows application using SQL Server as its database. I need
I have developed a Email service using Spring Java mail and Velocity Template like
I have developed an web application using JSP and deployed in tomcat server. In
I have developed an application using J9 that runs in windows mobile. but now
I have developed a small chat client using WPF. In each chat window, it

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.