≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
i want animate rotation, help pls
Posted by:
(you are not logged in)
Enter the missing letter in: "Internati?nal"
(you are not logged in)
Text:
[quote][b]chipchuh[/b] wrote: have this code: [code]/* Info Extension Name : Rotate towards target Extension Type : Action Author: : Vazahat Khan (just_in_case) Date Created : ??Don't remember Description : It allows you to rotate your scnenode in the direction of the target node. */ /* Donate If you like my work, please consider "buy me a cup of coffee" to support me. You can do that via PayPal :) PayPal: http://paypal.me/Vazahat */ /* <action jsname="action_rotatetowardstarget" description="Rotate an object towards another object"> <property name="Scenenode" type="scenenode" /> <property name="Target" type="scenenode" /> <property name="AdditionalRotation" type="int" default="180" /> </action> */ action_rotatetowardstarget = function() { }; action_rotatetowardstarget.prototype.execute = function(currentNode) { var position = ccbGetSceneNodeProperty(this.Scenenode, "Position"); var rotation = ccbGetSceneNodeProperty(this.Scenenode, "Rotation"); var pos_target = ccbGetSceneNodeProperty(this.Target, "Position"); var radians_Horizontal = Math.atan2(pos_target.x - position.x,pos_target.z - position.z); var degree_Horizontal = (radians_Horizontal * (180 / Math.PI)) ; ccbSetSceneNodeProperty(this.Scenenode,"Rotation",rotation.x, degree_Horizontal + this.AdditionalRotation, rotation.z); } // ***Author:- VAZAHAT PATHAN*** // ****AKA**** // ****Just_in_case**** [/code] It rotates the object immediately, I need it to rotate smoothly, animatedly, please help me to implement[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact