I have some trouble with the ‘z-axis.’
I have used the editor to create an ImageTransform background.
I have translation Z set to -500 so it always is behind other transforms.
Then I added a Scene: part of the blue sky.
I set Z to -499 so it is placed before the background but still behind all other transforms.
But then the problems begin:
I added another Scene (group of trees and plants, see picture).
I set its Scene Z to -498.
It disappeared!
I had to set Z to a minimum of 1 to display it in front of the ImageTransform background.
I don’t get that because the first Scene (the sky) is displayed allright with -499.
Then I added the 2 palm trees to the left and the bushes in the sand.
I set their Z to 3,4 etcetera and the large bush on the foreground I set to 8.
They all are placed over the previous Scene and are visible so this made sense (though I still do not understand why I could make the first scene have Z -499 but the next ones had to have positive z values.
So this is my first question.
Then:
I want to place a character sprite behind the large bush.
I thought this would work if I make the Z of it: 7. (as the bush has Z: 8 in design)
In code:
Procedure TAvatar.Position;
var V: TVector3;
begin
V := StatePlay.Location.NPC[2].Transform.Translation;
V.Z := WestBeachScene8.Translation.Z - 1;
Transform.Translation := V;
end;
But the character is placed in front of the bush.
If I make V.Z := -490;
Then it is placed behind the bush.
Every value higher than -490 will place the character in front of the bush.
If Z value is equal or lower than -500 it disappears (that makes sense for me because ImageTransform has Z value -500.
So I don’t understand this translation.z “error”.
(see for the “order of stuff hierarchy” the editor pictures in my previous topic).
P.s: I tested V.Y := WestBeachScene8.Translation.Y and this places the character halfway height of the bush, so this works okay.