I have been trying to do that for nearly 4 days now, I almost got it,
but there is still one error

what I am trying to do:
I place an object inside the overlay sprite, get screen x and y with
camera.screen(object3D) , object3D was created as a leading object for
the overlay sprite, all working fine so far, but the object is always
in a sort of billbord possition, that is perfect, but I wanted a bit
more

I started transforming the object using matrix3D to get the feeling
similar to a real projection of a plane, the best effect I got with
this:

var viewMatrix = new Matrix3D();
viewMatrix.rawData = camera.viewMatrix.rawData;
viewMatrix.prepend(flipY);

var overlayMatrix = new Matrix3D();
overlayMatrix .prepend(viewMatrix);
overlayMatrix .prepend(object3D.sceneTransform);

then I added the scale and possition

and at the end:
overlaySprite.transform.matrix3D = overlayMatrix ;

and it almost works! the sprite is transformed 80-90% like a plate
would, with one ERROR

when resizing the stage I change the x and y of the view, none
camera.viewMatrix nor object3D.sceneTransform know that the view
changed its possition and funny things happen to the overlaySprite

if I didn't set the position of the overlaySprite with the screen
values all would be fine, but the overlaySprite would be in the wrong
possition (however the transformation would be fine)

I also placed overlaySprite in additional sprite and transformed one
of them with or without setting the possition - nothing works

so, the only thing I can think of is to correct the x and y of the
overlaySprite, but I bet there are some better ways

Reply via email to