Papervision3d – Registration point workaround
I've been working with Papervision for a few weeks now, as I got 2 assignments where I had to use pv3d to enter the next dimension, after a fairly long learning curve I'm quite up the basics and ready to work on it, one of the downsides of the current version was the issue of not being able to move the registration point, also called pivot point or Anchor Point.
The workaround which I've worked with is pretty simple and it doesn't afford a lot of work, the downside is that you really need to develop a visual feeling for 3d space, which is not simple if you never worked with 3d packages like 3ds max or Maya
Let's have a look at how Papervision objects are built, in this example I'm going to take a simple primitive like a plane, have a look at the graphic below to understand how a plane is built.
So as you see the registration point of the plane has been created exactly in the middle of it, which is actually ok, but what if you want to rotate the plane on it's left edge? That won't work.. So the solution is just to place the object (in our case the plane) inside of a displayObject3d and reposition the plane inside the displayobject3d.
As you have seen on the graphic above, we insert our plane inside the displayObject3d (marked black) and we are now able to rotate the "plane" (marked red) from it's left edge. Let's have a look at the code.
1 2 3 4 | firstContainer = new DisplayObject3D(); primitive1.x = 505; firstContainer .addChild(primitive1); scene.addChild(firstContainer); |
First we create our DisplayObject called firstContainer, we position the primitive (in our case the plane) at the x coordinate 505, then we add the primitive1 to our firstContainer and last but not least you add the container to the scene.
From now on instead of rotating primitive1 we only rotate the whole firstContainer and the primitive will follow it as it's embedded in it.



May 5th, 2008 - 15:21
This is great. Very simple, but something I somehow overlooked. Thanks!
July 29th, 2008 - 23:41
Much appreciated. Thanks man.
August 20th, 2008 - 15:14
Thanks!
August 21st, 2008 - 00:14
No worries guys
June 16th, 2009 - 05:03
I was struggling for a while trying to properly position my planes. Then I thought “Hey maybe the registration point…”, then found your article and it confirmed that registration points are in the centre of the planes. Thanks very much!
July 8th, 2009 - 22:10
First hit on google, and it was exactly what I needed.
Thanks!