Jump to content
Mirek

AttachTo on moving/rotating object

Recommended Posts

Hi i have a light atached inside a cargospace of a plane by:

Spoiler

misto = VALK_2 modelToWorld [0,-4.75,0.75];                               
svetlo = "#lightpoint" createVehicle misto;  
svetlo setLightColor [1, 0.1, 0.1];  
svetlo setLightAmbient [1, 0, 0];  
svetlo setLightBrightness 5;  
svetlo setLightIntensity 1000;                                   
svetlo setLightAttenuation [1, 4, 4, 0, 1.5, 2];  
svetlo attachTo [VALK_2, [0, -4.75, 0.75]]; 
                                                                                            
misto_2 = VALK_2 modelToWorld [0,-7.25,0.75];                               
svetlo_2 = "#lightpoint" createVehicle misto_2;  
svetlo_2 setLightColor [1, 0.1, 0.1];  
svetlo_2 setLightAmbient [1, 0, 0];  
svetlo_2 setLightBrightness 5;  
svetlo_2 setLightIntensity 1000;                                   
svetlo_2 setLightAttenuation [1, 4, 4, 0, 1.5, 2]; 
svetlo_2 attachTo [VALK_2, [0, -7.25, 0.75]];

The problem is, that as the plane flyes and rotates and flips, the light changes possition relative to the plane. I vant the two lights to lit the inside of the cargo hold, but while the plane moves, the lights go all over the plane, and outside of the cargo hold. ANyone knows some solution?

Share this post


Link to post
Share on other sites

@Mirek,

There is no workaround for attaching lightpoints. Lights "jitter" because they do not update position fast enough.

The way I made the cabin lights in FTA and Jet Toys was to attach an actual light (single light object) to the plane and hide it in the geometry.

Keep in mind that AI hate attached objects on vehicles and it will cause erratic flight behaviour.

 

Have fun!
 

  • Like 1

Share this post


Link to post
Share on other sites

lightAttachObject  old command position is updated too slowly, so flickering at most with high moving object

attachTo  works for lights on objects. Not a question of attitude (pitch,bank,yaw) but also speed make the relative position moving (usually in front of speed vector, light is in advance/ object)...

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×