Title: Question about updating temporary global variable
Env
in case
[Taichi] mode=release
[Taichi] version 0.6.37, llvm 10.0.0, commit e0ac1d86, osx, python 3.8.3
[Taichi] Starting on arch=x64
In short
I want to access temporary variable(say init by ti.Vector() ) in taichi scope. However, the results turns out that in taichi scope , program could only capture the initial value of the temporary variable if the variable is not the input of this taichi scope function, but in py scope it could.
Bascially, the program has two forms of class trsfm, one(trsfm) init with ti.Vector, another(trsfrm_field) with ti.Vector.field().
My current implementation is class trsfrm, what I wanna do is to increment the translation member of class trsfrm and capture the incremented class trsfrm in taichi scope.
However, in kern_test_without_input it could only capture the initial value( keep printing [2.0, 2.0] instead of incrementing itself ). The funny thing to me is that: in py scope the t1 still updates itself . While in kern_test_input, with t1 as input it can capture the increasing value.
The truth is, the trsfrm_field no matter without or with input, the taichi scope could always capture the increasement.
The kern without input t1 is always the same. Due to some reasons I expect it to increase as well.
Sry about the wording
So The Question:
Is there an elegant way to capture the ti.Vector change in taichi global scope?
Why do I ask this?
I want to implement a transform class for collider in euler based fluid simulation in order to make the collider rotate or translate. [Here]() is the repo link.
The circle(collider) stands still if I do not make the transform.rotation as the function input in rendering function. (currently I access the )
Currently my walkaround is either
take as input
init with ti.field
But personally, I am not a big fan of capturing the increasement by adding t1 as input because in that way it may take undefined multiple number of colliders as input. And probably due to this, although the ball can rotate, the fps drops drastically(from 15fps -> 8fps). From the experience, it should not happen since the function did not change that much whether with or without the input.
Also init the transform member with ti.field is not that feasible to me because ti.field cannot be init after materialize or start an kernel function. In this way we somehow cannot trivially add new collider with transform as member to the scene.
Title: Question about updating temporary global variable
Env
in case
[Taichi] mode=release
[Taichi] version 0.6.37, llvm 10.0.0, commit e0ac1d86, osx, python 3.8.3
[Taichi] Starting on arch=x64
In short
I want to access temporary variable(say init by ti.Vector() ) in taichi scope. However, the results turns out that in taichi scope , program could only capture the initial value of the temporary variable if the variable is not the input of this taichi scope function, but in py scope it could.
To be clear, here we have this script:
What's the program?
Bascially, the program has two forms of class trsfm, one(trsfm) init with ti.Vector, another(trsfrm_field) with ti.Vector.field().
My current implementation is class trsfrm, what I wanna do is to increment the translation member of class trsfrm and capture the incremented class trsfrm in taichi scope.
However, in kern_test_without_input it could only capture the initial value( keep printing [2.0, 2.0] instead of incrementing itself ). The funny thing to me is that: in py scope the t1 still updates itself . While in kern_test_input, with t1 as input it can capture the increasing value.
The truth is, the trsfrm_field no matter without or with input, the taichi scope could always capture the increasement.
The program output is :
The kern without input t1 is always the same. Due to some reasons I expect it to increase as well.
Sry about the wording
So The Question:
Is there an elegant way to capture the ti.Vector change in taichi global scope?
Why do I ask this?
I want to implement a transform class for collider in euler based fluid simulation in order to make the collider rotate or translate. [Here]() is the repo link.
The circle(collider) stands still if I do not make the transform.rotation as the function input in rendering function. (currently I access the )
Currently my walkaround is either
But personally, I am not a big fan of capturing the increasement by adding t1 as input because in that way it may take undefined multiple number of colliders as input. And probably due to this, although the ball can rotate, the fps drops drastically(from 15fps -> 8fps). From the experience, it should not happen since the function did not change that much whether with or without the input.
Also init the transform member with ti.field is not that feasible to me because ti.field cannot be init after materialize or start an kernel function. In this way we somehow cannot trivially add new collider with transform as member to the scene.
So is there any walkaround for this ? 0.0
Hope my statement is clear and clean...