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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:00:23+00:00 2026-05-25T13:00:23+00:00

If anyone can get this guy’s small bit of code working on their machine,

  • 0

If anyone can get this guy’s small bit of code working on their machine, I’d be grateful if they could help me out by letting me know how.

I’ve taken the HTML and JS from this page: http://projects.harrynorthover.com/3dcircles/html/

Unfortunately when I run his code on my machine (on localhost), it won’t work (no circles appear).

I also had some problem with the CSS. I’m confused with it. I put the CSS inline to solve a problem with the default set-up loading the CSS (?)

The code that fails is at this point from the Chrome developer tool.

The modified HTML code (from yours truly) is like this:

<html> 
<head> 

<title>First 3D Javascript Experiment</title> 

<style> 
@CHARSET "UTF-8";
body {
    border:0;
    margin:0;
    padding:20;
    padding-top:10px;
    background-color:#111111;
}

h2 {
    color:#FFFFFF;
    font-size:18;
    font-family:Calibri;
    margin-left:10px;
}

p {
    color:#FFFFFF;
    font-size:12;
    font-family:Calibri;
    margin-left:10px;
}

.canvasHolder {
    width:800;
    height:590;
    border:thin dotted #CCCCCC;
}

canvas {
    border:thin dotted #666666;
}
</style> 

<script type="text/javascript" src="js/Three.js"></script> 

</head> 
<body> 

<h2>3D Circles</h2> 
<p style="color:#CCCCCC; float:left; padding-left:500px; margin-top:-31px;">A 3D experiment using Three,js, HTML5 Canvas & Javascript.</p> 

<p><b>Click anywhere</b> in the square to <b>draw</b> some lovely <b>circles</b>.</p> 
<p style="color:#666666; margin-top:-10px;">By Harry Northover - <b><a href="http://www.harrynorthover.com" style="color:#666666;">www.harrynorthover.com</a></b></p> 

<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script> 
<script type="text/javascript" src="js/3d.js"></script> 

</body> 
</html>

The JavaScript file where the error is occurring (all the files are loading fine), is like this ( init(); is the first function that is called)

// 3d vars.
var camera;
var scene;
var renderer;

// size
var WIDTH               = 800;
var HEIGHT              = 600;

var circleColours       = [0x0099CC, 0xCCCCCC, 0x9900CC];
var colourIndexToUse    = 0;
var fadeAmount          = 0.0000000005;

// used to tell when to draw.
var shouldDraw          = false;

// mouse coordinates.
var mouseX;
var mouseY;

setInterval( invalidate, 10 );

function init() {
    camera                  = new THREE.Camera( 75, WIDTH / HEIGHT, 1, 10000 );
    scene                   = new THREE.Scene();
    renderer                = new THREE.CanvasRenderer();
    renderer.setSize( WIDTH, HEIGHT );

    camera.position.z       = 700;
    document.body.appendChild( renderer.domElement );
}

function invalidate()
{
    if(shouldDraw) draw();
    // fade all the current circles.
    fade();
    // render it all.
    renderer.render( scene, camera );
}

function draw() {
     for(var i = 0; i < 4; ++i)
     {
         var particle           = new THREE.Particle( new THREE.ParticleCircleMaterial( circleColours[colourIndexToUse], Math.random() ) );

at which point the error is:

45 - Uncaught TypeError: undefined is not a function
draw3d.js:45
invalidate3d.js:35

I’ve copied over all the files I need (i.e. from the THREE.js download).

Please help, most confused

I’m assuming that because the error happens after at least some THREE components are loaded, it’s because some other files are needed or, not sure.

  • 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-05-25T13:00:23+00:00Added an answer on May 25, 2026 at 1:00 pm

    As far as I know I’ve copied over all the files I need (i.e. from the THREE.js download), but not 100% on that.

    You should become 100% sure on this point first.

    Here is how I got an example script running:

    1. Click ‘downloads’ and then ‘download .zip’ on the three.js github page
    2. Unzip that file
    3. Copied the build/Three.js file to my js folder

    Also note that for some of the examples included you’ll need the –allow-file-access-from-files argument when starting Chrome (not sure of the equivalent in other browsers). One jsermeno describes how to do so here.

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

Sidebar

Related Questions

We get this error in Visual Studio 2005 and TFS very often. Can anyone
Can anyone spot what is wrong with this URL rewrite? I can't get it
can anyone tell me why this code don't work: $q = $_GET['q']; // Load
Does anyone know how I can get rid of the following assembler warning? Code
I can't get this function to behave as i desire. Can anyone point out
Can anyone tell me how I can get this little margin between the tbar
http://www.security.org.sg/code/loadexe.html http://pastebin.com/QFHASx75 I've compiled this but can't get it to work properly, It runs
Can anyone get me with the regular expression to strip multiline comments and single
Can anyone get me a login page example for iphone ?
Can anyone tell me how can I get the xpath of the name attribute

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.