Problem with EntityParent
Archives Forums/Blitz3D Bug Reports/Problem with EntityParent
| ||
Using the global flag to retain an entity's global position/rotation/scale doesn't seem to always work. Please see this thread for full description and demo of problem. |
| ||
My previous explanation was somewhat vague. Here's what I think it boils down to.Graphics3D 800, 600, 0, 2 cam = CreateCamera() : PositionEntity cam, 0, 0, -15 : CameraZoom cam, 3 pivot = CreatePivot() ScaleEntity pivot, 2, 1, 1 RotateEntity pivot, 0, 0, 45 square = CreateCube() EntityParent square, pivot RenderWorld Flip WaitKey The pivot is stretched along the x-axis. It is rotated 45 degrees so the square ( really a cube ) is stretched along a diagonal. How could Blitz3D adjust the square's scale factors to compensate for this? |
| ||
Ah, I see what you're saying, now. However, I'm still somewhat perplexed, TBH. The square has a local rotation which, when parented to the pivot, should be set to -45, to compensate for the pivot's rotation. This would give the square a global rotation of 0. Surely entities are transformed using their global position/rotatio/scale, as this is how we see them on-screen. |
| ||
I'm not entirely sure about the situation either. In my example the square's transformation matrix could be set up to cancel out the skew effect. But this can't be achieved within the Blitz3D "rotate and scale" system. So maybe it is not allowed. |
| ||
It would be good if BRL could shed some light on this. :) |