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
- Testing Unity AI Beta
- Ways to Support UnityCoder Development
- Using UI Slider to Create 5-Star Rating Element
- Game Music Library For Unity (editor plugin)
- Fontastic : Easily Test Fonts in Unity Editor!
- GeoTiff Importer & Terrain Generator for Unity
- Create Baked DropShadow for UI images
- .JP2 Ortho Image Converter to PNG/JPG/TIFF
- Convert LAS/LAZ/PLY pointclouds to GLTF (GLB) Point Meshes (standalone converter)
- Detect SRP (URP or HDRP) with Assembly Definition Version Defines
- [LudumDare57] Theme: Depths
- MotionVector Effect: Object “disappears” when paused
Recent Comments
- on [Asset Store] PolygonCollider2D Optimizer
- on Trajectory Test Scene 2.0
- on Vector3 maths for dummies!
- on UnityHub 3.6.0: Remove Version Control & Cloud Dashboard columns
- on Using RenderDoc with Unity (graphics debugger)
- on UI Scroll View automatic Content height
- on [Asset Store] Point Cloud Viewer & Tools
- on [Asset Store] Point Cloud Viewer & Tools
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