Topic was automatically imported from the old Question2Answer platform.
Asked By
netimu
I am working on a project involving earth map projections.
I am trying to compute the gradient vector of a certain Scalar function in the most resource saving way. Does Godot offer a way to do so? if not any sort of help would be much appreciated.
it depends how you want to approach the issue.
the easier way is probably using dictionaries
var gradient={} #declare empty dictionary
gradient[position_vector]=local_gradient_vector #assign values at each position
although i dont know how “resource saving” this is.
Maybe a very long PoolVector array will compute faster, but it is more difficult to manage as you have to find a smart way to univocally links elements in the array to their position in space (eg: element n. 1000 equal to space position vector (103,2,19)) and viceversa.