≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
XYZ co-ordinates in front
Posted by:
(you are not logged in)
Enter the missing letter in: "Int?rnational"
(you are not logged in)
Text:
[quote][b]Newby[/b] wrote: Hi, Was wondering how to calculate just the distance in front of the player position only (not to the side) based on the X & Z target co-ordinates & perhaps position also. I notice how both X & Z change when I move the mouse up and down depending on the direction of the player - for the target co-ordinates. This is my code so far but it puts items in front but also to the side - not always only in front: var posn = ccbGetSceneNodeProperty(player, "Position"); var targ = ccbGetSceneNodeProperty(player, "Target"); var distX = ((targ.x - posn.x) * 0.04); var distY = (targ.y - posn.y); var distZ = ((targ.z - posn.z) * 0.04); ccbSetSceneNodeProperty(clone, "Position", posn.x+distX, posn.y+distY, posn.z+distZ);[/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