Relative Joint 2D

作者:追风剑情 发布于:2019-6-3 10:36 分类:Unity3d

固定两个GameObject的相对位置 示例:红色球使用了Relative Joint,绿色球使用了Spring Joint

阅读全文>>

标签: Unity3d

评论(0) 浏览(4604)

最小生成树-克鲁斯卡尔算法

作者:追风剑情 发布于:2019-6-2 18:02 分类:Algorithms

       在一个无向连通图G中,如果取它的全部顶点和一部分边构成一个子图G`,即V(G`)=V(G)和E(G`)⊆E(G`)。若边集E(G`)中的边,即将图G中的所有顶点连通,又不形成回路,则称子图G`是原图G的一棵生成树。显然无向连通图的生成树不是唯一的。连通图的一次遍历所经过的边的集合及图中所有顶点的集合就构成了该图的一棵生成树,对连通图的不同遍历,...

阅读全文>>

标签: Algorithms

评论(0) 浏览(4092)

编译GLTools源码

作者:追风剑情 发布于:2019-6-2 10:38 分类:OpenGL

下载源码 https://github.com/HazimGazov/GLTools 一、新建C++静态库项目,并把源码拷到工程中 二、通过NuGet安装nupengl 三、添加预处理宏_CRT_SECURE_NO_WARNINGS 四、生成GLTools.lib

阅读全文>>

标签: OpenGL

评论(0) 浏览(5173)

OpenGL画一个圆

作者:追风剑情 发布于:2019-6-2 9:56 分类:OpenGL

一、首先确保已经通过NuGet安装了nupengl 二、解决方案平台设置为x64 因为在x86下要报错,未找到原因 三、写示例代码 #include <GL/freeglut.h> //运行发布出来的exe时,不再显示dos窗口,但在VS中运行还是会显示。 #pragma comment(lin...

阅读全文>>

标签: OpenGL

评论(0) 浏览(4086)

Visual Studio 2017配置OpenGL

作者:追风剑情 发布于:2019-6-2 8:58 分类:OpenGL

参见 https://www.cnblogs.com/junjunjun123/p/8609159.html 1、安装nupengl (此包集成了OpenGL、FreeGLUT、GLFW、GLEW) 2、运行测试代码 #include <windows.h> #include <GL/gl.h> ...

阅读全文>>

标签: OpenGL

评论(0) 浏览(5496)

OpenGL简介

作者:追风剑情 发布于:2019-6-1 10:05 分类:OpenGL

OpenGL是一组图形硬件的一种软件接口。 OpenGL体系结构审核委员会(ARB, OpenGL Architecture Reiview Board)。 OpenGL的姊妹API——OpenGL ES OpenGL是跨平台和可移植的,并且几乎现有的所有3D硬件设备都有对应的OpenGL驱动。 OpenGL 3.0仍然兼容Open GL 2.1 OpenGL 3.1从核心规范中移...

阅读全文>>

标签: OpenGL

评论(0) 浏览(11466)

瓦片地图(Tilemap)

作者:追风剑情 发布于:2019-5-31 14:51 分类:Unity3d

一、准备精灵(sprite)素材 右键->Create->Sprites 二、创建Tile 右键->Create->Tile 三、创建Tile调色板(Tile Palette) Window->Tile Palette Pixels Per Unit...

阅读全文>>

标签: Unity3d

评论(0) 浏览(9080)

PingPong缓动

作者:追风剑情 发布于:2019-5-30 10:46 分类:Unity3d

示例 using System.Collections; using System.Collections.Generic; using UnityEngine; /// <summary> /// PingPong缓动 /// </summary> public class TweenPingPong : MonoBehaviour { public Vect...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4971)

鼠标控制物体缩放&旋转

作者:追风剑情 发布于:2019-5-29 11:10 分类:Unity3d

示例 using System.Collections; using System.Collections.Generic; using UnityEngine; /// <summary> /// 鼠标控制物体缩放&旋转 /// 注意:某些软件会造成按键冲突 /// </summary> public class MouseSca...

阅读全文>>

标签: Unity3d

评论(0) 浏览(16237)

脚本设置屏幕分辨率

作者:追风剑情 发布于:2019-5-29 10:59 分类:Unity3d

示例 using System.Collections; using System.Collections.Generic; using UnityEngine; public class ScreenResolution : MonoBehaviour { [Header("分辨率")] public int width = 1920; pub...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5545)

编辑Mesh顶点坐标

作者:追风剑情 发布于:2019-5-28 13:55 分类:Unity3d

场景截图 using System.Collections; using System.Collections.Generic; using UnityEngine; [ExecuteInEditMode] [RequireComponent(typeof(MeshFilter))] public class MeshVertexEditor :...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5965)

禁止屏幕睡眠

作者:追风剑情 发布于:2019-5-28 10:42 分类:Unity3d

private void Awake() { //防止屏幕变暗 Screen.sleepTimeout = SleepTimeout.NeverSleep; //用系统设置 //Screen.sleepTimeout = SleepTimeout.SystemSetting; }

阅读全文>>

标签: Unity3d

评论(0) 浏览(5155)

yield return

作者:追风剑情 发布于:2019-5-28 10:31 分类:Unity3d

using System.Collections; using System.Collections.Generic; using UnityEngine; public class WaitTest : MonoBehaviour { public int frame; void Start () { StartCoroutine(Wait...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4708)

UnityEngine.UI.VertexHelper

作者:追风剑情 发布于:2019-5-27 17:31 分类:Unity3d

示例:自定义UI几何图形 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class VertexHelperTest : MonoBehaviour { public MeshFilter me...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5575)

UnityEngine.Event

作者:追风剑情 发布于:2019-5-27 13:18 分类:Unity3d

监听键盘按键 private void OnGUI() { Event e = Event.current; if (e != null && e.isKey) { // Esc键 if (e.keyCode == KeyCode.Escape) { Application.Quit(); } } }

阅读全文>>

标签: Unity3d

评论(0) 浏览(13197)

物体沿贝塞尔曲线运动

作者:追风剑情 发布于:2019-5-23 21:45 分类:Unity3d

一、新建场景,如图 TrackDraw.cs using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// 在场景中显示轨迹 /// [ExecuteInEditMode]...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5926)

激活Windows 10

作者:追风剑情 发布于:2019-5-13 13:50 分类:其他

参考 https://baijiahao.baidu.com/s?id=1620924952478049508&wfr=spider&for=pc 在CMD中依次输入下面命令

阅读全文>>

评论(0) 浏览(5846)

利用BlendShape制作变形动画

作者:追风剑情 发布于:2019-5-10 21:37 分类:Unity3d

一、在Maya中利用混合变形器创建BlendShape 1、创建一个几何体,并复制一份 2、选中两个几何体(即,变形体和目标物体),并打开【创建混合变形选项】面板。 观察右侧属性编辑器 3、选中目标物体,导出为FBX文件,并导入到Unity工程中。 4、改变change.pCone1...

阅读全文>>

标签: Unity3d

评论(0) 浏览(6597)

UnityEngine.Video.VideoPlayer

作者:追风剑情 发布于:2019-5-7 21:59 分类:Unity3d

官方文档 https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html https://docs.unity3d.com/Manual/class-VideoClip.html 示例:在Plane上播放电影 导入一个电影文件,新建一个材质,新建一个RenderTexture。如图 ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(7878)

EditorGUILayout.Toggle()

作者:追风剑情 发布于:2019-5-7 11:47 分类:Unity3d

示例 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; public class GUIStyleWindow : EditorWindow { private bool group = true; priva...

阅读全文>>

标签: Unity3d

评论(0) 浏览(9308)

手动为角色绑定IK动画

作者:追风剑情 发布于:2019-5-6 20:43 分类:Unity3d

[官方文档] 反向动力学 可在 Mecanim 中用于已正确配置的任何人形Avatar骨骼。 一、导入角色模型,并进行设置 二、创建两个空对象IK_LeftHand、IK_RightHand用来对左右手部进行定位。 三、创建AnimatorController并创建一个空动画 启用IK Pa...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4936)

ConditionalAttribute

作者:追风剑情 发布于:2019-5-6 18:13 分类:C#

示例:除非定义了相应的宏,否则忽略方法调用 #define TOOL_B using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApp1 { class Pr...

阅读全文>>

标签: C#

评论(0) 浏览(3940)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号