Jump to content
Sign in to follow this  
Guest

rotating people

Recommended Posts

Guest odog

hi all,could someone (arno...) explain how to make my people macros rotate towards my plane...like gerrish's trees. I came up empty on a search...but its late.thanks in advance.odog

Share this post


Link to post
Share on other sites
Guest GerrishGray

Hi JoeYou could even try asking me direct!You cannot do this direct from gMax, but there is a command BGL_SPRITE_VICALL in BGLC, or RotateToAircraft() in SCASM, that provides the required functionality. As I believe that you do your designs in gMax(?), you will have to capture the assembler code, add the necessary code with the sprite call, and recompile with BGLC.It's not difficult, but if you like to send me the .asm code for one of your people, I will be happy to edit it for you to show you how to add the necessary stuff.Kind RegardsGerrishgerrish@flightsims.co.uk

Share this post


Link to post
Share on other sites
Guest odog

THANKS gerrish,i just mentioned arno because he answered like 10 post in a row when i posted my question. This is a FSSC creation, but I do usually use gmax. So ill send you the code anyway.thank you!odog

Share this post


Link to post
Share on other sites
Guest GerrishGray

Hi JoeThanks for the code - I see it's in SCASM! I'll reply to you direct in more detail later, but the basic change that will make the model rotate to face the viewer is to replace the present line 56 that reads

   RotatedCall( :B 0 0 %5 )

with

  RotateToAircraft( :B  0 0 0  0 0 1  0 0 0 )

... it's that easy.CheersGerrish

Share this post


Link to post
Share on other sites
Guest

I have quite a bit of experience using gmax but I know zilch about code and programming. I'm curious about all those numbers that come after the words RotateToAircraft.RotateToAircraft( :B 0 0 0 0 0 1 0 0 0 )What do they do? Thanks, Ryan the Glidiator

Share this post


Link to post
Share on other sites

They are all explained in the SCASM docs.Basically with the first 3 parameters you can set an offset (x,y, and z direction). Then with the next 3 you can set with axes should be used to rotate about (set that one to 1). The last 3 parameters can be used to let a variable control the rotation.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest manny3

Hi Ryan,The Scasm Documents says:RotateToAircraft( :Lab dx dz dy fx fy fz vx vy vz ) - CFS/FS2K old I_A7( :Lab dx dz dy fx fy fz vx vy vz ) This is a new sort RotatedCall. Can be used to automatically rotate something towards the players aircraft ;-) - :Lab Label of the called subroutine dx offset in x direction dz elevation offset dy offset in y direction fx if this flag is 1, the x axis is rotated towards the players aircraft. fy if this flag is 1, the y axis is rotated towards the players aircraft. fz if this flag is 1, the z axis is rotated towards the players aircraft. Note, normaly only one of these flags should be used in one command. vx variable containing x rotation angle, normally 0 vy variable containing y rotation angle, normally 0 vz variable containing z rotation angle, normally 0Found in Scacmd3.doc.Hope this helps.manny

Share this post


Link to post
Share on other sites
Guest GerrishGray

Hi allUnfortunately the SCASM documentation is not 100% accurate regarding this command[ul][li]The first three values, dx dz dy, are the offset of the centre of rotation from the current refpoint.[/li][li]The next three, fx fz fy, can indeed be used as simple flags as suggested, but are actually a constant angle that will be added to the natural angle of rotation. The object will not rotate around this axis if the given value is zero - hence the need to normally set the value to 1 to enable rotation (giving the impression of a flag!), but other values can be used.[/li][li]The last three, vx vz vy, are indeed offsets to variables, but the values in the variables will once again be added to the natural rotation angle.[/li][/ul]The arguments required by the equivalent BGL_SPRITE_VICALL macro in BGLC are identical.Most commonly, the 6th of the values, fy, is set to 1 and the others are left as 0. This results in a sprite that rotates so that its 'y' (i.e. N-S) axis rotates about the vertical axis of the refpoint to face towards the viewer (not the aircraft - note the important difference in spot view). One possibly confusing result of this behaviour is that one always views the reverse (i.e. 'Northern') side of the object, and this needs to be taken into account in the design. Note also that if you try to include a shadow from a sprite you may get some rather unrealistic results as the sprite rotates!Hopes this clears up any misunderstanding for those trying to get this command to work correctly!BTW, for those who have asked, this command is not directly accessible from gMax. You need to hack the .asm code and recompile it with BGLC if you want to use it with a gMax model :-)Kind RegardsGerrishP.S. Those familiar with SCASM will understand the unconventional use of the "x, z, y" directions in its documentation, which I have used above -- x is the E-W axis, z is the vertical axis, and y is the N-S axis and they are used in this sequence. BGLC, more conventionally, refers to them as "x, y, z" instead!

Share this post


Link to post
Share on other sites
Guest

Hi Gerrish,>Most commonly, the 6th of the values, fy, is set to 1 and >the others are left as 0. This results in a sprite that >rotates so that its 'y' (i.e. N-S) axis rotates about the >vertical axis of the refpoint to face towards the viewer >(not the aircraft - note the important difference in spot >view). One possibly confusing result of this behaviour is >that one always views the reverse (i.e. 'Northern') >side of the object, and this needs to be taken into account >in the design. Note also that if you try to include a shadow >from a sprite you may get some rather unrealistic results as >the sprite rotates! This explains my question why I had to draw the 'back' of my polygon to be able to see it when using the rotation sprite option. Thanks a lot Gerrish.Rafael

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...