Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Rotate Script

VP
Guest
Quote
2021-07-22 16:42:59

So I'm trying to write a simple rotation script for a camera dolly (to smooth the camera, when following an inclined model over bumpy terrain).....


var WD = ccbGetSceneNodeFromName("Walker(Dummy)");
var LProt = ccbGetSceneNodeProperty(WD, "Rotation");
var LP = ccbGetSceneNodeFromName("LevelPlatform");
ccbSetSceneNodeProperty(LP, "Rotation", LProt);


This works fine so far but: I only want it to get/set one rotation parameter (y axis), not all x, y, z axes.

How do I specifically instruct coppercube to get (or set) a single axis of rotation?


I was thinking it may be something like:
var LProt = ccbGetSceneNodeProperty(WD, "Rotation", y);


But it doesn't work.

Thanks.


VP
Guest
Quote
2021-07-22 17:02:13

Ah, I figured it out.... It's a . , not a , to specify an individual parameter.


ccbSetSceneNodeProperty(LP, "Rotation", LProt.y);



just_in_case
Moderator
Quote
2021-07-26 07:23:06

Glad that you started into scripting


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

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