This is what I am trying to do.

-------------------

(inside some class)

constructor()
-------------------
// (Cubes for 2x2x2 Cube Container)
cube1 = new Cube();
cube1.position = new Vector3D(0,0,0);

cube2 = new Cube();
cube2.position = new Vector3D(0,0,1);

....

cube8 = new Cube();
cube8.position = new Vector3D(1,1,1);

container = new ObjectContainer3D();
container.addChild(cube1);
...
container.addChild(cube8);

// Assuming each cube is 1x1x1, so the container should be 2x2x2
container.pivotPoint = new Vector3D(1,1,1);  // or new Vector3D(-1,
-1, -1)   I have tried both


update()
-------------------
container.rotationY += 1

-------------------

When I do something like this, it isn't rotating around the center of
the object.  In fact, it looks like the pivot point hasn't moved at
all.

On Jun 21, 11:55 pm, Choons <[email protected]> wrote:
> the pivot point of a container moves automatically to the calculated
> geometric center upon adding objects to it if I'm not mistaken
>
> On Jun 21, 10:04 pm, Jack <[email protected]> wrote:
>
>
>
>
>
>
>
> > I have tested it with (1000,1000,1000) as I said, It works well. 100
> > will not give u a good effect to observe.
> > Do you need my code?
>
> > On 6月21日, 下午6时30分, afuzzyllama <[email protected]> wrote:
>
> > > Thanks for the response.  I tried doing something like that and it
> > > still isn't doing anything.  It is like my pivot isn't getting set at
> > > all.  Also, why use such large numbers?  I thought since my cubes are
> > > 100x100x100 then I could assume my center point would be (# of cubes)/
> > > 2
>
> > > On Jun 21, 2:49 am, Jack <[email protected]> wrote:
>
> > > > On Jun 21, 10:59 am, afuzzyllama <[email protected]> wrote:
>
> > > > >  Greetings Away3D.dev group!
>
> > > > > I've been trying to creating procedural objects in Away3D broomstick,
> > > > > but I have run into a problem with object rotation.  I have inserted a
> > > > > bunch of cubes into an ObjectContainer3D, but when I do movePivot(),
> > > > > it doesn't seem to do anything when I execute a yaw() on the
> > > > > container.
>
> > > > > To give a pseudo code of what I am doing:
>
> > > > > container.addChild(cube1);
> > > > > container.addChild(cube2);
> > > > > container.addChild(cube3);
> > > > > container.addChild(cube4);
> > > > > container.movePivot(100, 100, 100);  // Cubes of default size
> > > > > (100x100x100) are placed into a bigger cube, so the max points should
> > > > > be 200, 200, 200...
> > > > >                                                       //  therefore
> > > > > the center should be 100, 100, 100
> > > > > cube.getBlockObject().yaw(1);
>
> > > > > The cubes are place correctly, but it looks like they are rotating
> > > > > around 0,0,0
>
> > > > > Can anyone shed light on my issue?  I feel like it is something I'm
> > > > > missing, but I cannot figure out how to get it to rotate correctly.
>
> > > > > Thanks,
> > > > > Ken
>
> > > > You' ll get a surprise if you move "container.movePivot(100, 100,
> > > > 100)" to a Event.ENTER_FRAME handler and you'd better to set it with a
> > > > larger number like (1000,1000,1000).
>
> > > > Cheer- 隐藏被引用文字 -
>
> > > - 显示引用的文字 -

Reply via email to