Spin in reverse direction
Spin in reverse direction
I wanted to know how to make something spin in reverse direction. Look like the "spin" function accept no direction variable
- Balthazar
- Moderator
- Posts: 2055
- Joined: Wed Nov 01, 2006 4:31 pm
- Location: Russian Federation
- Contact:
Re: Spin in reverse direction
Try using numbers of angles below zero, like -2, -5 and so on.
Re: Spin in reverse direction
Thank for you answer, but Spin don't have angle variable.
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
Re: Spin in reverse direction
The spin function takes several parameters (in the Lua scripting API):
Where unitID is the 'this' parameter (it's designed to be called like this:spin(this.piece, ...) ). Setting speed to something negative should make the model piece spin in reverse direction.
Code: Select all
spin(unitID, obj, axis, speed, (accel))
=>;-D Penguin Powered
Re: Spin in reverse direction
Lua ? What is lua ? You speak also of a "this"... I mean, i need to learn C coding ?
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
Re: Spin in reverse direction
There are 3 ways of animating models:
Scripting a unit with Lua is similar to scripting in COB. You first declare the pieces of your model, then for each function which is needed for your unit you write animation commands which looks like:
You can find the whole list of Lua functions here : http://trac.ta3d.org/browser/trunk/docs ... otypes.txt
I recommend you look at some of the Lua scripts from the free data set. Most of them implements the same animation as their COB equivalent from OTA.
- use default animation parameters for 3DM models (doesn't work on units)
- write a COB script (OTA scripting language) to animate a unit model (unit only)
- write a Lua script (using TA3D's Lua API) to animate a unit model (unit only)
Scripting a unit with Lua is similar to scripting in COB. You first declare the pieces of your model, then for each function which is needed for your unit you write animation commands which looks like:
Code: Select all
-- turn the leg around x axis until it reaches 90° at 45°/sec
this:turn(this.leg, x_axis, 90, 45)
I recommend you look at some of the Lua scripts from the free data set. Most of them implements the same animation as their COB equivalent from OTA.
=>;-D Penguin Powered
Re: Spin in reverse direction
Okay, i look at it. Thank for the link.
Re: Spin in reverse direction
Where can i find the "free data set" ? If its' the "ta3d-data" from the server, i have that error when i try to install it :
Code: Select all
Réception de : 1 ftp://downloads.ta3d.org/binaries/linux/apt/ testing/main ta3d-data 0.0.1 [65,2MB]
65,2Mo réceptionnés en 1min 52s (581ko/s)
(Lecture de la base de données... 208252 fichiers et répertoires déjà installés.)
Dépaquetage de ta3d-data (à partir de .../ta3d-data_0.0.1_all.deb) ...
dpkg : erreur de traitement de /var/cache/apt/archives/ta3d-data_0.0.1_all.deb (--unpack) :
impossible de créer « /usr/share/games/ta3d/resources/anims/corint/paneltop/paneltop.png.dpkg-new » (pendant le traitement de « ./usr/share/games/ta3d/resources/anims/corint/paneltop/paneltop.png »): Aucun fichier ou dossier de ce type
dpkg-deb: sous-processus coller tué par le signal (Relais brisé (pipe))
Des erreurs ont été rencontrées pendant l'exécution :
/var/cache/apt/archives/ta3d-data_0.0.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
- zuzuf
- Administrateur - Site Admin
- Posts: 3281
- Joined: Mon Oct 30, 2006 8:49 pm
- Location: Toulouse, France
- Contact:
Re: Spin in reverse direction
Interesting ... I didn't notice the package was broken.
Yes the free data set is the ta3d-data package but you can also find it there : http://downloads.ta3d.org/mods/ta3d_free_data_set.7z (I've just updated it)
Yes the free data set is the ta3d-data package but you can also find it there : http://downloads.ta3d.org/mods/ta3d_free_data_set.7z (I've just updated it)
=>;-D Penguin Powered
Who is online
Users browsing this forum: No registered users and 1 guest