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
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
- Check if point is inside polygon 2D (using line intersection)
- UnityHub: Enable Create Project Button (without having to select Cloud Organization)
- UI: Make Tooltip background fit Text content length
- Pong-Wars in Unity
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub)
- UnityHub: Add support for custom project title (instead of folder name) or use ProductName
- Testing Unity MUSE AI
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