Moebius transformation modifier

Hey ya’ll,
It’s been a while! I used to come around this forum in high school as “fitchmicah”. Anyhow, this is my first blender hack-in-progress. It has to do with something called the Moebius transformation, seen here in 2D:


.

Daniel Piker’s blog has a four page writeup on this, which totally captivated me when I first saw it, so I stayed up day and night, implementing it as a GLSL shader. The results can be seen here: http://hyperspectives.timbremill.net.

So here is a rough, buggy patch: https://github.com/timbresmith/Hyperspectives/blob/master/blender/moebiusModifier.diff

And some examples:


The blends for these can be found here: http://github.com/timbresmith/Hyperspectives/tree/master/blender

Right now the modifier is very simple, as is my understanding of the math. So for now the only parameter is a control object. The control objects quaternion is used to construct the two matrices described here.

Later on I’d like to add some more stuff like vertex groups, different coordinate options, etc. Let me know what you think. Critical feedback is greatly appreciated!

Also: for some reason the modifier doesn’t always work. I have to kill blender and start it again, then it works. It’s very strange. I do not understand it yet.

This looks very interesting. I have no idea how it works or what to use it for, but the effect sure looks beatifull!

Pretty cool…

This is messing with my mind…

congrats! funny mod. moving 2nd object a bit gives differents shapes and can be used for something like “magnitude” slider so the shape doesn’t hit the camera.


here only works after entering in editmode and works only in edit mode when used after subsurface. maybe is a problem with derivedMesh or something?

:slight_smile: I’m excited that you got a chance to play with it!!! And thanks for the insight on a maybe there being problem with derivedMesh. I guess I came to the right forum category! My method so far has often been to look at other modifiers and copy what they’re doing… I guess I should look at the documentation again and step through the chain of how derivedMesh works.

The thing that gets me is how, from the get-go, sometimes it works and sometimes it doesn’t. Maybe I am missing some kind of initialization?

are you sure it’s not the same problem? for example when i load your examples they don’t work before entering edit mode. probably it makes some confusion ir you are creating-editing new objects and loading existing ones.

the problem with subsurface could be something related to this (maybe, i’m still trying to understand the stack too)

All modifiers take a DerivedMesh as input. For deforming modifiers, that change the vertex coordinates of the mesh, the modifiers must only fill an array of vertices coordinates. Modifiers that change the structure of the mesh must provide a DerivedMesh as output. For nearly all modifiers a cdDM should be created. The subsurf modifiers makes an exception here, and used its own ccgDM for efficiency, since it deals with large amounts of elements.

for me it worked in the same way everytime but i didn’t so many tests.
http://wiki.blender.org/index.php/Dev:Source/Modeling/DerivedMesh

http://wiki.blender.org/index.php/Dev:Source/Modifiers/Stack/Implementation

http://wiki.blender.org/index.php/Dev:Source/Modifiers

Spent way too long messing with this today and fixed a couple bugs --> http://pasteall.org/41122/c

The manhattan distance thing was just me looking through the vector math header and going hmm…

thanks for catching that left/right rotation matrix problem! fixing that gets rid of the weird flattening effect.

the “dist” variable is poorly named and really is supposed to be distance squared!

i have made a git repository to work from with the fixes here: https://github.com/timbresmith/hyperblender/tree/moebius . i’ll try and update that link to point to a new diff soon!

also, the manhattan distance thing is interesting. i hadn’t heard of that before. check out this wikipedia article on the “minkowski distance” which is a generalization of manhattan distance (p=1) and euclidean distance (p=2). here’s what happens to the unit circle (or sphere) when you vary the power:

Hey I updated the diff to include changes suggested by Uncle Entity. Here again is the link: https://github.com/timbresmith/Hyperspectives/blob/master/blender/moebiusModifier.diff

here’s an example of a chain loop rotated so that one of the links encloses the others:


https://github.com/timbresmith/Hyperspectives/raw/master/blender/mobiuschain.blend