1

My code return x,y,z with each keypoint and how can I overlay a 3D object on my Finger tip. I had follow this https://discourse.threejs.org/t/setting-up-renderers-canvas-element-by-html-id/13213 but its still no work ! what i had is a black screen , i had already remove line document.body.appendChild( renderer.domElement ); Image show keypoint on hand

Mugen87
  • 28,829
  • 4
  • 27
  • 50
Aiden Pearce
  • 13
  • 1
  • 3
  • If all you got is a black screen that sounds more like ThreeJS is not even starting or the render cycle not being called at all. Could you add a [minimally reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) in Codepen or JSFiddle? – adelriosantiago Oct 26 '20 at 18:58
  • https://jsfiddle.net/3ntog9y2/, here is my code . I Cant render a box on my canvas ! – Aiden Pearce Oct 27 '20 at 02:50

1 Answers1

0

The problem is that you obtain a 2D and 3D rendering context on the same canvas element which is not supported. More information about this topic here:

https://stackoverflow.com/a/5016197/5250847

The three.js scene in your fiddle can be fixed by commenting out var context = canvas.getContext('2d'); and properly set the size of the WebGL renderer.

Updated fiddle: https://jsfiddle.net/p6fL0md5/1/

Mugen87
  • 28,829
  • 4
  • 27
  • 50