ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator getting the rotation of a scene node and setting another nod to that rotation
person icon
dev
Registered User
Quote
2023-06-21 08:07:57

Sorry I'm new to coppercube and I was wondering how I would go about that

thanks,

person icon
SamGrady
Guest
Quote
2023-06-21 18:59:52


var fromNode = ccbGetSceneNodeFromName("cubeMesh1");
var toNode = ccbGetSceneNodeFromName("cubeMesh2");

var rot = ccbGetSceneNodeProperty(fromNode,"Rotation");

ccbSetSceneNodeProperty(toNode,"Rotation",rot);


person icon
dev
Registered User
Quote
2023-06-22 05:35:15

Thankyou, I wouldn't believe how much this helped

person icon
Dieter
Guest
Quote
2023-08-21 10:31:46

Maybe additionally, these Properties like "Rotation", "Position" and "PositionAbs" return and accept a 3D vector variable. But they also accept 3 single parameters.
So after a
var rot = ccbGetSceneNodeProperty(fromNode,"Rotation");
I can say:
var pitch =rot.x;
var yaw =rot.y;
var roll =rot.z;

Then I could set the rotation like
ccbSetSceneNodeProperty(fromNode,"Rotation",pitch,yaw+1,roll);
so it would progressively turn around the Y axis.


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |