BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Rotation dependent on trackdistance

4 posters

Go down

solved Rotation dependent on trackdistance

Post by Ski Tube 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?
Ski Tube
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 Tue Jul 10, 2012 1:37 pm

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

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Ski Tube 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?
Ski Tube
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 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.
graymac
graymac

Posts : 2134
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 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?
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by Ski Tube 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.
Ski Tube
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 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?
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

solved Re: Rotation dependent on trackdistance

Post by graymac 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.
graymac
graymac

Posts : 2134
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 Wed Jul 11, 2012 1:41 pm

Also DemoRoute1, but it seemed to be gone.
alvinhochun
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 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
Ski Tube
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 Wed Jul 11, 2012 2:02 pm

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

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

solved Re: Rotation dependent on trackdistance

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

Thanks to everyone who offered to help, the problem is now solved
Ski Tube
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

Back to top

- Similar topics

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