AmesingFlank / taichi.js

Modern GPU Compute and Rendering in Javascript
https://taichi-js.com
MIT License
447 stars 20 forks source link

How to set data to a field? #17

Open JenLyndle opened 1 month ago

JenLyndle commented 1 month ago

I have a field declared like this: let scalarField = ti.field( ti.types.vector(ti.types.vector(ti.f32, 2), 3), 2 ); basically this should hold data like this: [ [[0,3], [4,5], [6,7]], [[6,7], [8,9], [10,11]] ] Am not sure how to populate this field. fromArray works for 1D f32/i32 values, but am not sure how to put this data into the field.

JenLyndle commented 1 month ago

I find that needing to use compile time constants for matrix and vertices is very limiting. thoughts?