# Gravitational Lensing simulation on a line.

Hello all !

I’m trying to simulate the gravitational lensing effect on a line.

Like this :

The size, position and gravitational force of the star should be adjustable, in order to play with the curvature of the line.
I think I would be able to build it in Cinema 4D with the “bend” deformer, so I searched for an equivalent SOP in TouchDesigner.

I tested with the “Twist SOP” but it applies on the entire line (not only in the star area).
The result doesn’t need to be scientificaly right…

Does something like that already exists somewhere ?

Thanks !
Flo

Maybe playing around with a metaball and the magnet SOP could lead to something similar

Ah ?

Does the metaball work with a line ?
Maybe I should work with a very long cylinder…

Do you know a good tutorial to understand how metaball and magnet SOP works ?

Thanks !
Flo

If you open Help->Op Snippets, there are some examples for Metaball and Magnet SOP.

Magnet SOP should be able to affect a line. Of course the line must have more than 2 points in order for this to look more or less like what you want.

That being said, i think the metaball/magnet SOP thing will give you some deformation thats kind of similar, but not sure if you can reach what you described above, so a straight line, a curve and then a straight line again…

Maybe you will need to program this yourself with python/glsl

another idea, but depending on your situation this might be not very practical:

You could emit a single particle and put the force (a metaball->force sop) where your star is.
Then the particle should be really very close to what you want.

You can then use a trail sop to make a line out of it

Hey, I was trying something similar with the particle SOP, here is the source file.
(I need to have 6 different beams, so I put a line > point > sort > particle)
beam light.37.toe (6.57 KB)

But at the end i need to have different colors for each beam. So I have to find a way to generate particules from one point only and change the color.

And I don’t want to have dots…
I don’t know how to use the Trail SOP, so I will dig into it…

Thanks !

Flo

You can set color attributes on a per point basis with the point sop and some scripting