Question

I'm trying to put a 3D model into a PDF file. When I load the PDF file in Acrobat, it comes up.

However, when I use the rotate, spin, or hand control, the 3D image stays in the same orientation while the camera viewpoint seems to point in different directions, so even a slight rotate will send the image off the screen unless I zoom way out. This is the opposite of how it should work: the camera should stay still while the 3D image rotates.

I'm the third guy to be working on this code, and it shows. The software is a combination of libharu, the U3D code from Sourceforge (Intel's castoff code, essentially), and some stuff written by an intern.

So, has anybody seen anything like this and found out why it's happening? Is there any reference out there for programmatically building a PDF file with 3D images that is better at explaining things than the PDF standard? Any other suggestions on how to approach this?

Was it helpful?

Solution

I figured it out.

In the PDF spec, section 13.6.4, there is the definition of camera viewpoint. It includes several things, one of which I didn't quite understand at first: the CO value. What this does is sets the center of rotation of the point of view, which is the CO value directly in front of the camera.

What happened is that a negative number got into the CO in this case. That put the center of rotation some number of negative units in front of the camera, which meant that the center of rotation was behind the camera. That meant that the point of view traveled around a sphere some distance away from the image, and so couldn't get around the image but could point away from it.

For anybody programmatically building a 3D image in a PDF, if you have a CO value, make sure it's positive.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top