≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Position reference by javascript
Posted by:
(you are not logged in)
Enter the missing letter in: "Internati?nal"
(you are not logged in)
Text:
[quote][b]srfstudio[/b] wrote: I'm not sure what form I should use to make Position property readable for other nodes :( This code is functioning but I have to write the XYZ coordinates manually: [code]var sourceNP1 = ccbGetSceneNodeFromName("np1"); var newscenenode1 = ccbCloneSceneNode(sourceNP1); ccbSetSceneNodePositionWithoutCollision(newscenenode1, 100.0, 10.0, 100.0);[/code]What I need is something like this: [code][b]var np1pos = ccbGetSceneNodeFromName("box1"); var np1_pos = ccbGetSceneNodeProperty(np1pos, "Position");[/b] var sourceNP1 = ccbGetSceneNodeFromName("np1"); var newscenenode1 = ccbCloneSceneNode(sourceNP1); ccbSetSceneNodePositionWithoutCollision(newscenenode1, [b]np1_pos[/b]);[/code]I have tried... [b]np1_pos.x, np1_pos.y, np1_pos.z[/b] / [b]np1_pos[0], np1_pos[1], np1_pos[2][/b] ...but it's not working. Does anyone knows how I should break Position property as a var/vector so that I can use it as a reference for other nodes?[/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