-
-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* C to Fortran translation * Swap the enums for raw parameters * Add a simple example.
- Loading branch information
1 parent
6fd081a
commit ad91a75
Showing
3 changed files
with
2,671 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Getting Started | ||
|
||
Here's an example for creating a 128x128 array of OpenSimplex2S noise | ||
|
||
```Fortran | ||
program test_fast_noise | ||
use :: fast_noise_lite | ||
use, intrinsic :: iso_c_binding | ||
implicit none | ||
type(fnl_state) :: noise_state | ||
real(c_float), dimension(128,128) :: noise_data | ||
integer(c_int) :: x, y | ||
! Create the state. | ||
noise_state = fnl_state() | ||
noise_state%noise_type = FNL_NOISE_OPENSIMPLEX2S | ||
! Collect the noise data. | ||
do y = 1,128 | ||
do x = 1,128 | ||
noise_data(x,y) = fnl_get_noise_2d(noise_state, real(x, c_float), real(y, c_float)) | ||
end do | ||
end do | ||
! Do something with this data... | ||
end program test_fast_noise | ||
``` |
Oops, something went wrong.