Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / StarField.cs
Created May 11, 2025 11:36 — forked from silverua/StarField.cs
Script for StarField background in Unity from this tutorial: https://www.youtube.com/watch?v=yu23OAd_Wrw&list=LL
using UnityEngine;
using Random = UnityEngine.Random;
public class StarField : MonoBehaviour
{
private Transform thisTransform;
private ParticleSystem.Particle[] points;
public int starsMax = 100;
public float starSize = 1f;
@unitycoder
unitycoder / DynamicMesh.lua
Created May 21, 2025 19:33 — forked from grilme99/DynamicMesh.lua
Example of Roblox's new DynamicMesh class, generated using ChatGPT. Works at runtime in an ordinary LocalScript.
-- Create a new DynamicMesh instance
local dynamicMesh = Instance.new("DynamicMesh")
-- Function to get perlin noise
local function perlinNoise(x, y, scale, height)
return math.noise(x * scale, y * scale) * height
end
local size = 50 -- Size of the terrain
local scale = 0.1 -- Scale factor for Perlin noise
@unitycoder
unitycoder / TexturedMeshSteps.md
Created May 21, 2025 20:13 — forked from shubhamwagh/TexturedMeshSteps.md
Steps to create textured mesh from point cloud using Meshlab

Steps to create Textured Mesh from Point Cloud using Meshlab

Get your PointCloud into MeshLab

  • Import the pointcloud file in ".ply" file format in Meshlab. Before importing make sure you do some pre-processing / cleaning on point cloud so as to ease the process of meshing.

Point Cloud Simplification and Normals Computation

  • Next we need to reduce the number of point samples for smooth meshing.
    • So go to Filters -> Point Set -> Point Cloud Simplification. Enter Number of samples circa 5% of original number of points. Make sure Best Sample Heuristic is checked.
  • After point cloud simplification, make sure to select Simplified point cloud in the Show Layer Dialog on the right hand side. If not visible, it can be opened by navigating to View -> Show Layer Dialog. Now we need to compute normals for point set.
  • So go to Filters -> Point Set -> Compute normals for point sets . Enter Neighbour num between 10 - 100. Initially try with 10 and
@unitycoder
unitycoder / UnityGMail.cs
Created August 28, 2025 10:04 — forked from marcotmp/UnityGMail.cs
Code to send email from unity using a Google account.
using System.ComponentModel;
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class UnityGMail
{
public void SendMailFromGoogle()
{
using System;
using UnityEngine;
using UnityEngine.Rendering;
using Random = System.Random;
namespace StellarConquest.Presentation.Unity
{
public class StarfieldMeshBuilder : MonoBehaviour
{
public float SphereRadius = 4000;