Vector coordinates of SEPARATION_PLANE

#1
Hi,

I tried to make docking guidance system according to arno's tutorial. Everything works when the object is rotated 360. ( Vector is 0,0,-1 that means at opposite dircetion 180 ). But it does not work in another rotation.

There is no description how the vector in SEPARATION_PLANE should look. I tried both Z, X, Y and X, Z, Y and it didn't work. I wrote vector with length of 1 into it ( f.e. for gate that has heading 245 i tried 0.906, 0, 0.4226, and 0, 0.906, 0.4226, and none of them worked ). :banghead:

It is always easier to ask than to reinvent the wheel, so I am asking. Thankx for help.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Hi Filip,

It is much easier to make your object so that you can use one of the main axis for your distance checking. You can then rotate it while you place your object.

It is possible to define the vector at an angle, but I would have to lookup the source for that. Can't remember it by mind.
 
#3
So the vector is relative to the object and not absolute to FS?
This was what I was trying to make as my first attempt and did not work neither. But I might have done something wrong, I'll give it another try.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
Yes, that is how it should be. Relative to your object. The only thing you should remember is that it is your viewpoint that is used and not the reference point of the aircraft. So when you are in spotplane view it might work different then you thought.
 

rhumbaflappy

Moderator
Staff member
Resource contributor
#5
I don't know if this will help, but here's the reference from the FS2000 Scenery SDK:

Code:
BGL_SEPARATION_PLANE (0x25) – Normal vector with a dot product reference used to decide which side of an imaginary plane the eye is on.

Length            14 bytes

ENUM16           opcode              BGLOP_SEPARATION_PLANE = 0x25
SINT16            alternate_jump    jump to if normal * eye – dot_ref < 0
XYZ16             normal               normal vector of the polygon (32767 =1.0, -32767 = -1.0) 
SINT32            dot_ref              dot product reference
So the XYZ are the normals, and they would range from -1.0 to 1.0 ( -32767 decimal to 32767 decimal ).


Dick
 
#6
Hi, I still can not make the docking work in any direction but 360.
I am adding my code and testing XML, maybe you can help me find what is wrong and why distance works on object rotated 360, and does not work on object rotated 245. Maybe I just do understand it wrong way.

Thanx a lot

edit : I corrected it works when rotation is 360.
 

Attachments

Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#7
OK, I will have a look at your files (and test my own docking system again to be sure). But it is too late now, will have a look tomorrow evening.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#8
Hi Filip,

Oops, you are right. They do indeed not turn when you rotate the object. I am going to test something else on my docking system now and will update the tutorial if it does work. Making a docking system for each heading is no option :).
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#9
Hi Filip,

For me this worked, can you verify if it also solves your problem.

I replaced this code:

Code:
SEPARATION_PLANE di11, 0, 0, -1, 26
With this code:

Code:
IFIN1 di11, 0386h, 13, 14
The variable 0386h is the negative y axis in GMax, which is the axis along which I made my docking system. It seems that the unit for the SEPARATION_PLANE command was in 0.5 meters, but 0386h seems in meters. So I divided by 2.
 
#10
Thank you a lot, I am going to try it now.

If I can test Y axis, I suppose I can test X axis too. Can you give me its adress too? Or simplier, is there any documentation about all adresses taht can be tested?

And one more question... if such an adress exist, can it be also used by cat?
 
#12
Hi,

I wass testing adress 0386h you wrote to me ( and also 0382h and 037Eh ) and they appears that they do not rotate with the object. It apears to me that theese are distances at X, Y and Z axis of the FS itself, not of the Gmax object and they do not rotate with object.

Here is again a sample of code:
 

Attachments

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#13
This is getting irritating :). I will have another look at it.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#14
Humm, you are right :(. This is very frustrating. It seems there is no distance check command that does respond to rotations made with the XML commands. Let me think of a new solution....
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#15
I have done some thinking and the only working alternative for my docking system would be to use the distance variable 033B I think. As long as you are lined up correctly that works, but it is not really optimal.

Any comments or suggestions?
 
#16
033Bh of course does work as expected. I'll use it until I'll find some more elegant solution. One more is not as good for me - in your docking system, the position of the plane to the side is simple because of the stick.

On LKPR, there is a moving yellow stripe and that will be harder to achieve without testing the rotation, but I hope I'll find some workaround.

Thank you a lot for your help..



One more small idea to think about...

I was thinking about objects in FS and I found one object, that actualy shows depending on position of the aircraft. The lights before the runway. How are they displayed? Cannot we try to use that? Just an idea of course....
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#17
Hi Filip,

Yes, I also have a different type of docking system where the left/right indication is done digital. At this moment I have no clear idea yet how to solve this. It frustrates me that most commands don't work properly in the new RIFF format.

I think the runway lighting is hard coded in the scenery engine, so I am not sure if we can see what kind of commands are used there.
 
Top