Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CBA_fnc_randomVector3D #1151

Merged
merged 3 commits into from
May 25, 2019
Merged

add CBA_fnc_randomVector3D #1151

merged 3 commits into from
May 25, 2019

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented May 24, 2019

When merged this pull request will:

@commy2 commy2 added the Feature label May 24, 2019
@commy2 commy2 added this to the 3.12 milestone May 24, 2019
@PabstMirror
Copy link
Contributor

PabstMirror commented May 25, 2019

distribution doesn't look right
image

edit: what about vectorNormalized [-1 + random 2,-1 + random 2,-1 + random 2] (it technically could fail but the odds are very slim)

@commy2
Copy link
Contributor Author

commy2 commented May 25, 2019

vectorNormalized [-1 + random 2,-1 + random 2,-1 + random 2]
This is not uniformly distributed. It will bias towards where the 8 edges are of the cube.

You would have to discard all results that lie outside the sphere first (vecMag > 1) and reroll in that case before normalizing.

The problem with my math was that elevation went from 0° to 180° instead of -90° to 90°. I fixed it. Please test with that script of yours.

Copy link
Contributor

@PabstMirror PabstMirror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good now

@commy2 commy2 merged commit f781740 into master May 25, 2019
@commy2 commy2 deleted the randomVector3D branch May 25, 2019 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants