Physijs icon indicating copy to clipboard operation
Physijs copied to clipboard

TypeError: THREE.BoxGeometry is not a constructor in examples on latest Build

Open 7schlaefer opened this issue 10 years ago • 6 comments

Hey, amazing Library! I get an error with the latest Files in all examples: TypeError: THREE.BoxGeometry is not a constructor. Why is three.js outdated that much on your rep? And wich Three.js version works best with physijs at the moment? Thanks

7schlaefer avatar Aug 01 '14 15:08 7schlaefer

Three.js r67 works for me with latest Physijs version, didn't get r68 to work though. What versions have you used?

maxg0 avatar Aug 04 '14 05:08 maxg0

The latest (r69 ) works with all examples ... chandlerprall seems to have updated the examples code, to work with the new version of threejs but not added the the new three.js file ...

hutzlibu avatar Nov 13 '14 12:11 hutzlibu

NAVER - http://www.naver.com/

[email protected] 님께 보내신 메일 <Re: [Physijs] TypeError: THREE.BoxGeometry is not a constructor in examples on latest Build (#194)> 이 다음과 같은 이유로 전송 실패했습니다.


받는 사람이 회원님의 메일을 수신차단 하였습니다.


jihoonbyun avatar Nov 13 '14 12:11 jihoonbyun

I'm getting this error as well

sjkillen avatar Mar 12 '15 06:03 sjkillen

Getting this error in MeteorJS

ThreeD.coffee

# Things set by init()
camera   = null
controls = null
mesh     = null
renderer = null
scene    = null

init = ->
  # Create and insert new 3D Renderer
  renderer = new THREE.WebGLRenderer()
  renderer.setSize window.innerWidth, window.innerHeight
  document.body.appendChild renderer.domElement

  # Create new Scene
  scene = new THREE.Scene()

  # Create Orthographic Camera using Isometric math.
  aspect = window.innerWidth / window.innerHeight
  d = 20
  camera = new THREE.OrthographicCamera( - d * aspect, d * aspect, d, - d, 1, 1000 )

  # method 1 - use lookAt
  #camera.position.set 20, 20, 20
  #camera.lookAt scene.position

  # method 2 - set the x-component of rotation
  camera.position.set 20, 20, 20
  camera.rotation.order = 'YXZ'
  camera.rotation.y = - Math.PI / 4
  camera.rotation.x = Math.atan( - 1 / Math.sqrt 2 )

  # Create Camera controls
  #controls = new THREE.OrbitControls( camera, renderer.domElement );
  #controls.addEventListener( 'change', render );
  #controls.noZoom = true;
  #controls.noPan = true;
  #controls.maxPolarAngle = Math.PI / 2;
  #controls.zoomSpeed = 0.1;

  # Add Ambient Scene Lighting
  scene.add new THREE.AmbientLight 0x444444 

  # Create Pointed Lighting
  light = new THREE.PointLight 0xffffff, 0.8
  light.position.set 0, 50, 50
  scene.add light

  # Axes
  scene.add new THREE.AxisHelper 40;

  # Grid
  geometry = new THREE.PlaneGeometry 100, 100, 10, 10
  material = new THREE.MeshBasicMaterial
    wireframe: true
    opacity: 0.5
    transparent: true
  grid = new THREE.Mesh geometry, material
  grid.rotation.order = 'YXZ'
  grid.rotation.y = - Math.PI / 2
  grid.rotation.x = - Math.PI / 2
  scene.add grid

  # geometry
  geometry = new THREE.BoxGeometry 10, 10, 10

  # material
  material = new THREE.MeshNormalMaterial()

  # mesh
  mesh = new THREE.Mesh geometry, material
  scene.add mesh

render = ->
    renderer.render scene, camera

Template.MapThreeD.rendered = ->
  $(document).ready ->
    init()
    render()

Console (Log)

2015-09-06 17:21:09.375 debug.js:41 TypeError: THREE.BoxGeometry is not a function
    at init (ThreeD.coffee:64)
    at HTMLDocument.<anonymous> (ThreeD.coffee:78)
    at jQuery.Callbacks.fire (jquery.js:3143)
    at Object.jQuery.Callbacks.self.add [as done] (jquery.js:3189)
    at jQuery.fn.ready (jquery.js:3423)
    at Template.MapThreeD.rendered (ThreeD.coffee:77)
    at template.js:116
    at Function.Template._withTemplateInstanceFunc (template.js:437)
    at fireCallbacks (template.js:112)
    at null.<anonymous> (template.js:205)

AlbinoGeek avatar Sep 07 '15 00:09 AlbinoGeek

Three.js r125 removed support for Geometry. Please use custom BufferGeometry. https://threejsfundamentals.org/threejs/lessons/threejs-custom-buffergeometry.html

NaveenNirban avatar Jun 16 '21 09:06 NaveenNirban