24
2014
Mobius strip Mesh Generator

^Current results.. drawn with Debug.Drawline() for now..
Trying to create möbius strip mesh using a script..
Founded some formulas here: (and it even has .obj exporter, but rather do it inside unity..)
http://www.java2s.com/Open-Source/CSharp_Free_Code/3D/Download_Helix_3D_Toolkit.htm
TODO:
– Build mesh (möbius strip)
** Well there is now better ready working unity version available here: https://bitbucket.org/alexzzzz/procedural-shapes-for-unity
So this one was not finished, here is the current source: (MobiusMaker.cs)
// Mobius strip formula from http://www.java2s.com/Open-Source/CSharp_Free_Code/3D/Download_Helix_3D_Toolkit.htm
// Not finished.. (Enable Gizmos in GameView to see lines)
using UnityEngine;
using System.Collections;
public class MobiusMaker : MonoBehaviour {
void Start () {
float pi = Mathf.PI;
float x=0f,y=0f,z=0f;
Vector3 pos = Vector3.zero;
Vector3 oldPos = Vector3.zero;
int n = 100;
int m = 10;
for (int i = 0; i < n; i++)
{
float u = 1.0f * i / (n - 1);
for (int j = 0; j < m; j++)
{
float v = 1.0f * j / (m - 1);
int ij = (i * m) + j;
u *= 2f * pi;
v = -1f + 2f * v;
float c1 = Mathf.Sin(u);
float c2 = Mathf.Cos(u);
float c3 = Mathf.Sin(u/2);
float c4 = Mathf.Cos(u/2);
x = c2+v*c4*c2;
y = c1+v*c4*c1;
z = v*c3;
pos.Set(x,y,z);
Debug.DrawLine(pos+new Vector3(0,0.01f,0),pos,Color.green, 100);
}
}
}
}
Related Posts
3 Comments + Add Comment
Leave a comment
Recent posts
- Adding Real World Location to Ice Fishing Prototype
- [web tool] Image Channel Inspector : AlphaScope
- Editor Tool: Smart Recompile (don’t recompile if edit comments)
- Editor Tool: Scene Size Analyzer
- LudumDare 60: Old Tech
- uBasic Scripting Language for Unity
- GreaseMonkey+Editor Plugin: 1-Click Copy script from ChatGPT (Web) to Unity Editor (as script)
- Editor Tool: Property Watcher
- .unityignore : Hide files from Project window
- PostBuild Script to Create Single exe Standalone File
- Game Loop Designer
- Favorites in PackageManager
Recent Comments
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by












Seeking Unity coders for worldwide game releases with distribution. mrk1200@gmail.com Must have experience with Unity and show the games you have coded.
Do you have website for more info..?
Moebius Transformations of 3D spaces on 4D sphere in Vertex shader and C# in Unity 3D
https://github.com/IRCSS/3D-Moebius-Transformations-Vertex-shader-in-Unity-3D