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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:20:18+00:00 2026-06-11T13:20:18+00:00

I am getting this error while drawing Helix Curve. I’ve added latest Curve.js and

  • 0

I am getting this error while drawing Helix Curve. I’ve added latest Curve.js and TubeGeormetry.js. Is this because of Canvas rendering or Am I doing something wrong ? I am follwing this example http://mrdoob.github.com/three.js/examples/webgl_geometry_extrude_splines.html

 <!DOCTYPE html>
    <html lang="en">
        <head>
            <title>3d Model using HTML5 and three.js</title>
            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
            <style>
                body {
                    font-family: Monospace;
                    background-color: #f0f0f0;
                    margin: 0px;
                    overflow: hidden;
                }
            </style>
        </head>
        <body>

            <script src="three.min.js" type="text/javascript"></script>
            <script src="Curve.js" type="text/javascript"></script>
            <script src="TubeGeometry.js" type="text/javascript"></script>      
            <script src="Stats.js" type="text/javascript"></script>
            <script src="Detector.js" type="text/javascript"></script>

            <script>
            // variables
            var container, stats;

            var camera, scene, renderer, splineCamera, cameraHelper, cameraEye;

            var text, plane, tube, tubeMesh, parent;

            var targetRotation = 0;
            var targetRotationOnMouseDown = 0;

            var mouseX = 0;
            var mouseXOnMouseDown = 0;

            var windowHalfX = window.innerWidth / 2;
            var windowHalfY = window.innerHeight / 2;

            var binormal = new THREE.Vector3();
            var normal = new THREE.Vector3();

            // extrudePath, Helix Curve
            extrudePath = new THREE.Curve.create(   
                    function() {

                    },  
                    function(t) {   
                        var a = 30; // radius
                        var b = 150; //height
                        var t2 = 2 * Math.PI * t * b / 30;
                        var tx = Math.cos(t2) * a,
                            ty = Math.sin(t2) * a,
                            tz = b * t;

                        return new THREE.Vector3(tx, ty, tz);   
                    }   
                );

            // Tube Geometry
            var segments = 400;
            var closed = false;
            var debug = false;
            var radiusSegments = 12;

            // add tube
            addTube();      

            function addTube()
            {
                alert('hello');                     
                tube = new THREE.TubeGeometry(extrudePath, segments, 2, radiusSegments, closed, debug);

                // Tube Mesh
                tubeMesh = THREE.SceneUtils.createMultiMaterialObject( tube, [
                    new THREE.MeshLambertMaterial({
                        color: color,
                        opacity: geometry.debug ? 0.2 : 0.8,
                        transparent: true
                    }),
                    new THREE.MeshBasicMaterial({
                        color: 0x000000,
                        opacity: 0.5,
                        wireframe: true
                })]);
                parent.add(tubeMesh);
            }

            init();                     
            animate();

            function init(){

                // container
                container = document.createElement( 'div' );
                document.body.appendChild( container );

                // info div
                info = document.createElement( 'div' );
                info.style.position = 'absolute';
                info.style.top = '10px';
                info.style.width = '100%';
                info.style.textAlign = 'center';
                info.innerHTML = 'Drag to spin the cylinder<br/> You can identify cylinder face by clicking on it.</br>';           
                container.appendChild( info );

                // camera
                camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 10000 );
                camera.position.set(0,150,400);

                // scene            
                scene = new THREE.Scene();
                camera.lookAt(scene.position);

                // light            
                scene.add( new THREE.AmbientLight( 0x404040 ) );
                light = new THREE.DirectionalLight( 0xffffff );
                light.position.set( 0, 1, 0 );
                scene.add( light );

                // CONTROLS
                controls = new THREE.TrackballControls( camera );

                // Grid
                geometry = new THREE.Geometry();
                geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
                geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );

                for ( var i = 0; i <= 20; i ++ ) {

                    line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } ) );
                    line.position.z = ( i * 50 ) - 500;
                    scene.add( line );

                    line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } ) );
                    line.position.x = ( i * 50 ) - 500;
                    line.rotation.y = 90 * Math.PI / 180;
                    scene.add( line );
                }

                parent = new THREE.Object3D();
                parent.position.y = 100;
                scene.add( parent );

                // projector
                projector = new THREE.Projector();

                // renderer
                renderer = new THREE.CanvasRenderer();
                renderer.setSize( window.innerWidth, window.innerHeight );
                container.appendChild( renderer.domElement );               

                // stats
                stats = new Stats();
                stats.domElement.style.position = 'absolute';
                stats.domElement.style.top = '0px';
                container.appendChild( stats.domElement );

                document.addEventListener( 'mousedown', onDocumentMouseDown, false );
                document.addEventListener( 'mouseover', onDocumentMouseOver, false );
                document.addEventListener( 'touchstart', onDocumentTouchStart, false );
                document.addEventListener( 'touchmove', onDocumentTouchMove, false );               

                window.addEventListener( 'resize', onWindowResize, false );

            }           

            function onWindowResize() {

                camera.left = window.innerWidth / - 2;
                camera.right = window.innerWidth / 2;
                camera.top = window.innerHeight / 2;
                camera.bottom = window.innerHeight / - 2;
                camera.aspect = window.innerWidth / window.innerHeight;
                //camera.updateProjectionMatrix();
                renderer.setSize( window.innerWidth, window.innerHeight );

            }

            function onDocumentMouseDown( event ) {
                event.preventDefault();

                document.addEventListener( 'mousemove', onDocumentMouseMove, false );
                document.addEventListener( 'mouseup', onDocumentMouseUp, false );
                document.addEventListener( 'mouseout', onDocumentMouseOut, false );

                mouseXOnMouseDown = event.clientX - windowHalfX;
                targetRotationOnMouseDown = targetRotation;         
            }

            function onDocumentMouseMove( event ) {

                mouseX = event.clientX - windowHalfX;

                targetRotation = targetRotationOnMouseDown + ( mouseX - mouseXOnMouseDown ) * 0.02;

            }

            function onDocumentMouseUp( event ) {

                document.removeEventListener( 'mousemove', onDocumentMouseMove, false );
                document.removeEventListener( 'mouseup', onDocumentMouseUp, false );
                document.removeEventListener( 'mouseout', onDocumentMouseOut, false );

            }

            function onDocumentMouseOut( event ) {

                document.removeEventListener( 'mousemove', onDocumentMouseMove, false );
                document.removeEventListener( 'mouseup', onDocumentMouseUp, false );
                document.removeEventListener( 'mouseout', onDocumentMouseOut, false );

            }

            function onDocumentMouseOver( event ) {

                document.removeEventListener( 'mousemove', onDocumentMouseMove, false );
                document.removeEventListener( 'mouseup', onDocumentMouseUp, false );
                document.removeEventListener( 'mouseout', onDocumentMouseOut, false );

            }

            function onDocumentTouchStart( event ) {

                if ( event.touches.length === 1 ) {

                    event.preventDefault();

                    mouseXOnMouseDown = event.touches[ 0 ].pageX - windowHalfX;
                    targetRotationOnMouseDown = targetRotation;

                }

            }

            function onDocumentTouchMove( event ) {
                if ( event.touches.length === 1 ) {
                    event.preventDefault();
                    mouseX = event.touches[ 0 ].pageX - windowHalfX;
                    targetRotation = targetRotationOnMouseDown + ( mouseX - mouseXOnMouseDown ) * 0.05;
                }
            }

            function animate() {
                requestAnimationFrame( animate );
                render();
                update();
            }

            function update()
            {
                controls.update();
                stats.update();
            }

            function render() {             
                parent.rotation.y += ( targetRotation - parent.rotation.y ) * 0.05;         
                camera.updateMatrixWorld();
                renderer.render( scene, camera );
            }           

            </script>
        </body>
    </html>     
  • 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-11T13:20:19+00:00Added an answer on June 11, 2026 at 1:20 pm

    you are not instantiating your curve object correctly. you should be doing

    extrudePath = new (THREE.Curve.create(...))();
    

    or in a way simpler to understand.

    CustomCurve = THREE.Curve.create(...);
    extrudePath = new CustomCurve();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error while working on map (Drawing line on map using GetDirection
I'm getting this error while doing a git svn rebase in cygwin Out of
I'm getting this error while doing rake:seed. can't mass-assign protected attributes I know that
I´m getting this error while trying to commit to a svn repository: svn: MKACTIVITY
I am getting this error While running this LoadError: Expected /home/user/Desktop/Tripurari/myapp/app/models/host.rb to define Host##
I am getting this error while i am trying to upload a database that
I keep getting this error while trying to modify some tables. Here's my code:
in the aspx page i am getting this error while binding dropdown list Unable
I'm new to AS3 and I'm getting this error while trying to implement OO
I am using zendgdata library for google calendar. I am getting this error while

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.