Rotation dependent on trackdistance

View previous topic View next topic Go down

solved Rotation dependent on trackdistance

Post by Ski Tube on Tue Jul 10, 2012 1:33 pm

I would like something to rotate a particular angle when the train is within a certain distance, so I feel it's a combination of rotation and stateFunction command. How can I do that?
Think of it similar to a level crossing beam, it is vertical when no train is around, and horizontal when a train is approaching. get my point?
avatar
Ski Tube

Posts : 63
Join date : 2011-08-16
Location : Earth

http://skitubeprogress.blogspot.com

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Dexter on Tue Jul 10, 2012 1:37 pm

Yes, you only need to rotate it - using proper condition, angle and damping ratio will do... Smile
avatar
Dexter

Posts : 1842
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Ski Tube on Wed Jul 11, 2012 5:36 am

Derryck wrote:Yes, you only need to rotate it - using proper condition, angle and damping ratio will do... Smile

I'm still relatively new to .animated objects, could you tell me exactly how this works?
avatar
Ski Tube

Posts : 63
Join date : 2011-08-16
Location : Earth

http://skitubeprogress.blogspot.com

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by graymac on Wed Jul 11, 2012 10:27 am

You need to see the OpenBVE documentation for developers, get it from Odakyufans site. Also it can help to study existing animations and see how the code is structured. To gain full understanding you need to be adept at boolean algebra and if you understand the C# language it helps.
Otherwise, the guidelines and a few experiments usually get a result.
avatar
graymac

Posts : 1745
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Dexter on Wed Jul 11, 2012 12:07 pm

Ski Tube wrote:I'm still relatively new to .animated objects, could you tell me exactly how this works?

Just to clarify - do you need the object rotated after the train is in some defined distance from it?
avatar
Dexter

Posts : 1842
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Ski Tube on Wed Jul 11, 2012 12:30 pm

Derryck wrote:
Ski Tube wrote:I'm still relatively new to .animated objects, could you tell me exactly how this works?

Just to clarify - do you need the object rotated after the train is in some defined distance from it?

I would like my object to rotate clockwise by 90 degrees when the train is approaching, within 100 meters, and rotate back 90 degrees anti clockwise when the train has left, after 50 meters.
avatar
Ski Tube

Posts : 63
Join date : 2011-08-16
Location : Earth

http://skitubeprogress.blogspot.com

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Dexter on Wed Jul 11, 2012 1:13 pm

I see. You will need conditions them. I might look into it later today, but no promises, I have enough to do. Which axis?
avatar
Dexter

Posts : 1842
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by graymac on Wed Jul 11, 2012 1:28 pm

If you look at the animated level crossings on the Killavalley branch you might find that I have already done what you're trying to do.
avatar
graymac

Posts : 1745
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by alvinhochun on Wed Jul 11, 2012 1:41 pm

Also DemoRoute1, but it seemed to be gone.
avatar
alvinhochun

Posts : 88
Join date : 2012-05-08
Location : Hong Kong

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Ski Tube on Wed Jul 11, 2012 1:44 pm

Derryck wrote:I see. You will need conditions them. I might look into it later today, but no promises, I have enough to do. Which axis?

All three, but in separate objects.. Each object will have rotation along a single axis only
avatar
Ski Tube

Posts : 63
Join date : 2011-08-16
Location : Earth

http://skitubeprogress.blogspot.com

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Dexter on Wed Jul 11, 2012 2:02 pm

OK, so you will just use different command, that is not a problem.
avatar
Dexter

Posts : 1842
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Ski Tube on Wed Jul 18, 2012 4:45 am

Thanks to everyone who offered to help, the problem is now solved
avatar
Ski Tube

Posts : 63
Join date : 2011-08-16
Location : Earth

http://skitubeprogress.blogspot.com

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum