I should know the answe to this, but....

View previous topic View next topic Go down

solved I should know the answe to this, but....

Post by thehoviskid on Wed Jul 18, 2012 1:03 pm

If I want use an ANIMATED file to place varaios .b3d files, how do i simply rotate one of those items 180 degrees. The documentation seems a little vague on it. In a .b3d i'd use Rotate 0,0,1,180, but that doesn't apply here....

I've found lines like
Code:
RotateXFunction = value + delta * speedometer / 0.30
but
Code:
RotateZFunction = 180
doesn't work. Do i have to specify a formula not a value?

I feel i should know the answer, but....
avatar
thehoviskid

Posts : 130
Join date : 2011-07-09
Age : 39
Location : Heysham

Back to top Go down

solved Re: I should know the answe to this, but....

Post by graymac on Wed Jul 18, 2012 4:07 pm

Can you not rotate the required item by inserting the usual "RotateAll" in the .b3d file itself? If the item is already used unrotated elsewhere, make a copy, index it and use that copy in the animated container.

Rotate X, Y, Z, Angle
RotateAll X, Y, Z, Angle
X: The x-direction of the rotational axis. Negative values point to the left, positive ones to the right. The default value is 0.
Y: The y-direction of the rotational axis. Negative values point to the left, positive ones to the right. The default value is 0.
Z: The z-direction of the rotational axis. Negative values point to the left, positive ones to the right. The default value is 0.
Angle: The angle to rotate in degrees. Negative values rotate counter-clockwise, positive ones clock-wise. The default value is 0.
The Rotate command rotates all vertices that have been created so far in the current [MeshBuilder] section via the Vertex, Cube or Cylinder commands. Subsequent vertices are not affected. The axis of rotation is specified via the X, Y and Z values. Rotation will occur in the plane perpendicular to that direction. A zero vector for this axis is treated as (1,0,0). All other directions are normalized. You can use as many Rotate commands as desired in a [MeshBuilder] section. The RotateAll command not only affects the vertices generated in the current [MeshBuilder] section, but also those created in previous [MeshBuilder] sections. This is useful to insert at the end of the file in order to rotate the whole object.
avatar
graymac

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

http://www.celtictrainsim.com

Back to top Go down

solved Re: I should know the answe to this, but....

Post by joeyfjj on Wed Jul 18, 2012 6:35 pm

Anyway, .animated files uses radians, not degrees.

joeyfjj

Posts : 262
Join date : 2011-07-30
Location : Singapore

http://openbve.joeyfoo.com

Back to top Go down

solved Re: I should know the answe to this, but....

Post by Dexter on Wed Jul 18, 2012 9:20 pm

Provided we know the command uses radians and we also know angle in radians = angle in degrees * Pi / 180 , a simple Rotate[DesiredAxis]Function = 3.141592654 will do for you.
avatar
Dexter

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

http://www.brnobve.eu

Back to top Go down

solved Re: I should know the answe to this, but....

Post by johnsinden on Wed Jul 18, 2012 10:16 pm

So that's what you get up to on your honeymoon..........................!
avatar
johnsinden

Posts : 210
Join date : 2011-09-19
Age : 64
Location : Southampton, UK

Back to top Go down

solved Re: I should know the answe to this, but....

Post by Quork on Wed Jul 18, 2012 10:25 pm

Huh, you know women need breaks for breathing^^


...sorry, railway personnel humour is blatant sometimes Laughing
avatar
Quork

Posts : 1073
Join date : 2012-05-05
Age : 25
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

solved Re: I should know the answe to this, but....

Post by thehoviskid on Wed Jul 18, 2012 10:51 pm

Well, what i'm trying to do is use an animated file to place 3 objects in object viewer, so i can see how they look together in extensions.cfg without having to fire up a route.

Here's what i'd put (using the suggestions above):
Code:
[Include]
F.Animated
Position = 0,0,0

[Include]
C.Animated
Position = 0,0,18.6

[Include]
R.Animated
Position = 0,0,37.2
RotateZFunction = 3.141592654
and that produces this error:
Code:
The attribute RotateZFunction is not supported at line 12 in file BlahBlahBlah.ANIMATED

I want to reverse the 3rd object (where in extensions.cfg, i'd use
Code:
Reversed = True
The first and last objects are similar and use common elements, and so are built facing the same way.

So, maybe it's just that Object Viewer doesn't support that?
avatar
thehoviskid

Posts : 130
Join date : 2011-07-09
Age : 39
Location : Heysham

Back to top Go down

solved Re: I should know the answe to this, but....

Post by Quork on Wed Jul 18, 2012 10:56 pm

Does R.ANIMATED contain animation? If so, RotateX/Y/ZFunction won't work.
avatar
Quork

Posts : 1073
Join date : 2012-05-05
Age : 25
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

solved Re: I should know the answe to this, but....

Post by thehoviskid on Wed Jul 18, 2012 11:01 pm

No, although there's nested animated files here, at leach level they're used to contain a number of static b3d files.
avatar
thehoviskid

Posts : 130
Join date : 2011-07-09
Age : 39
Location : Heysham

Back to top Go down

solved Re: I should know the answe to this, but....

Post by mrknowitall on Wed Jul 18, 2012 11:42 pm

thehoviskid wrote:Well, what i'm trying to do is use an animated file to place 3 objects in object viewer, so i can see how they look together in extensions.cfg without having to fire up a route.

Here's what i'd put (using the suggestions above):
Code:
[Include]
F.Animated
Position = 0,0,0

[Include]
C.Animated
Position = 0,0,18.6

[Include]
R.Animated
Position = 0,0,37.2
RotateZFunction = 3.141592654
and that produces this error:
Code:
The attribute RotateZFunction is not supported at line 12 in file BlahBlahBlah.ANIMATED

I want to reverse the 3rd object (where in extensions.cfg, i'd use
Code:
Reversed = True
The first and last objects are similar and use common elements, and so are built facing the same way.

So, maybe it's just that Object Viewer doesn't support that?

I notice you ask the simulator to do a command, but this will o ly work if you tell it when to do a command, IE RotateZfunction ( what you want it to do) =(if) min [leftdoors] (the command)

Normally if you are just checking in one animated file, copy and paste your .b3d file and them add the command inside the new .b3d file, then add

[object]
states =
posistion =

Hope that helped mate.
avatar
mrknowitall

Posts : 711
Join date : 2011-07-09
Age : 24

http://www.bve-terminus.org/pioneertrains/

Back to top Go down

solved Re: I should know the answe to this, but....

Post by thehoviskid on Wed Jul 18, 2012 11:46 pm

Ah, gotcha. To apply the rotation, i need to treat it as if i was animating it, but that won't work because you can't animate an animated object, so what i was trying to do can't work.

But now i know why...

Many thanks folks!
avatar
thehoviskid

Posts : 130
Join date : 2011-07-09
Age : 39
Location : Heysham

Back to top Go down

solved Re: I should know the answe to this, but....

Post by Dexter on Sat Jul 21, 2012 8:20 am

johnsinden wrote:So that's what you get up to on your honeymoon..........................!

Not quite, I was just having 30 minutes of spare time. Very Happy
avatar
Dexter

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

http://www.brnobve.eu

Back to top Go down

solved Re: I should know the answe to this, but....

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