Skip to content

Instantly share code, notes, and snippets.

View lowteq's full-sized avatar

lowteq lowteq

View GitHub Profile
@lowteq
lowteq / gojo.py
Created December 2, 2019 15:05
ユークリッドの互除法
def gojo(m, n):
return m if n == 0 else gojo(n, m % n)
x, y = map(int, input().split())
print(gojo(x, y))
@lowteq
lowteq / SteamVR_LaserPointer.cs
Created December 27, 2019 12:05
子のrigidbodyにもraycastが反応するように修正したSteamVR_LaserPointer.cs
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
using UnityEngine;
using System.Collections;
namespace Valve.VR.Extras
{
public class SteamVR_LaserPointer : MonoBehaviour
{
public SteamVR_Behaviour_Pose pose;
@lowteq
lowteq / BroochEditor.cs
Created January 9, 2020 22:59
UnityEditorWindow上で外枠のパスを入力し立体物に変換するスクリプト
using UnityEngine;
using System;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
public class BroochEditor : EditorWindow
{
private class PathTool
{
using UnityEngine;
using System;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
public class BroochEditor : EditorWindow
{
private class PathTool
{
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
#if UNITY_EDITOR
using UnityEditor;
public class BroochEditor : EditorWindow
{
private class PathTool
@lowteq
lowteq / dynamicraymarching.shader
Created February 1, 2020 20:28
dynamicraymarchingshader 未完成 standardshaderの最小構成
Shader "dynamicraymarching"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo", 2D) = "white" {}
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
@lowteq
lowteq / select_pointgzero.py
Created February 9, 2020 01:39
select points where x is greater than 0
import bpy
import bmesh
bpy.ops.object.mode_set(mode='OBJECT')
obj = bpy.context.active_object
bpy.ops.object.mode_set(mode='EDIT')
mesh = bmesh.from_edit_mesh(obj.data)
bpy.ops.mesh.select_all(action="DESELECT")
for v in mesh.verts:
@lowteq
lowteq / applyCurveMirror.py
Last active February 20, 2020 03:22
blender2.7x curveをmirror適用
import bpy
def axislist(axisbool):
r = []
for i in range(len(axisbool)):
l = [False,False,False]
if axisbool[i]:
l[i] = True
r.append(l)
@lowteq
lowteq / charsshader.shader
Created March 5, 2020 04:29
文字をランダムに表示するシェーダー
Shader "Unlit/charshader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
@lowteq
lowteq / charshader.shader
Created March 8, 2020 14:08
文字をランダムに表示するシェーダー GPUInstancingでオブジェクト毎に表示を変える(カメラの距離で描画が変わってしまうのでだめ)
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
Shader "Unlit/charshader_babel"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_sw("string length in line",int) = 30
_line("line",int) = 20