Problem with EntityParent

Archives Forums/Blitz3D Bug Reports/Problem with EntityParent

big10p(Posted 2007) [#1]
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.


Floyd(Posted 2007) [#2]
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?


big10p(Posted 2007) [#3]
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.


Floyd(Posted 2007) [#4]
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.


big10p(Posted 2007) [#5]
It would be good if BRL could shed some light on this. :)