0

I'm trying to display a 3D model from BodyParts3D using Three.js. For example, this 3D model of the human stomach (check the box and click Download). But try as I might, I have been unable to do it.

I first tried the 'naive' approach of substituting the '.obj' file for the one in the three.js obj-loader example. There are no error messages. The object just doesn't display anywhere. I played around with the configuration of the camera, the lighting and the object. No luck. None of the tips from this question have helped me either.

I am quite inexperienced with 3D, so I'm probably missing something simple. I would greatly appreciate some pointers.

I should point out that I am able to load the models with ArtOfIllusion, so they definitely 'work'.

Community
  • 1
  • 1
mhelvens
  • 4,225
  • 4
  • 31
  • 55

1 Answers1

1

I am not sure if I downloaded the same object as you did but the objects in the stomach zip are not centered around (0,0,0). In fact the center of the object is at (38.2862, -137.925, 1098.39). So before rendering the object you need to transform it close to zero or move your camera there.

gaitat
  • 12,449
  • 4
  • 52
  • 76
  • Indeed. I believe the BodyParts3D models are laid out in their correct anatomical positions, relative to each other. But I've tried (unsuccessfully) to correct for that. I'm now wondering if it might be some texture-related issue, rendering the object invisible? --- Anyway, if you've managed to display this particular object with three.js, seeing your code would help me a great deal. – mhelvens Apr 07 '14 at 15:13
  • I think it is better if you post some code and we try to fix it. – gaitat Apr 08 '14 at 14:22
  • No need. I finally figured it out. :-) I thought the 'real' object center would be reflected in `object.position`. This is, of course, not true, so I never properly corrected for this. I'm now getting the real center from the geometry. Thanks! – mhelvens Apr 09 '14 at 14:33