≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Value calculation problem
Posted by:
(you are not logged in)
Enter the missing letter in: "In?ernational"
(you are not logged in)
Text:
[quote][b][/b] wrote: Hey, so, knowing that it returns this weird value if it is larger than 1 or lower than -1, I basically capped the value: [code]... var rawX1 = (t1.x*t2.x + t1.y*t2.y + t1.z*t2.z) / (Math.sqrt (t1.x*t1.x + t1.y*t1.y + t1.z*t1.z) * Math.sqrt (t2.x*t2.x + t2.y*t2.y + t2.z*t2.z)); if (Math.abs (rawX1) > 1) rawX1 = sign (rawX1); var rawX = Math.acos (rawX1); ... function sign (number) { return (Math.abs (number) / number); }[/code] Don't know if this way is good or not, but nothing bad happened from it. In fact, the issue is solved (for now), so, works for me I guess. It also solved one other issue I had, but that is to be kinda expected. Thanks guys![/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