最速曲线时间 斜坡顶部起点P0, 底部终点P1根据动势能守恒,1/2m * v * v = m * g * h可以得到vmax = 2 * g * h,也就是说到可以得到到达底部的最大速度vmax无论是斜坡还是最速曲线到达底部终点的速度大小一样,都是vmax。不考虑方向思考无论是恒定加速还是不均匀加速都遵循 V[n] = V[n-1] + A[n-1] * △t即末速度 = 初速度 +
USocket UE4TCP UDP接口 // USocket.cpp : 定义控制台应用程序的入口点。////#define printf_s printf#include "stdafx.h"#include #include #include typedef struct{ SOCKET* server; SOCKET* tcp;}*LPPeerSocket,PeerSocket;typedef voi
WPF控件截图裁剪 Public Shared Function CaptureUI(ui As FrameworkElement, Optional pngpath As String = Nothing) As BitmapSource Dim offset As Vector = VisualTreeHelper.GetOffset(ui) Dim rtbmp As New
OpenGL PBO 的一点经验 Public Sub RenderTest() Dim t0 As Double = Now.TimeOfDay.TotalMilliseconds GL.BindBuffer(BufferTarget.PixelPackBuffer, pbo) REM 书上说了,当用PBO的时候,glReadPixels是异步的,测试了一下,Intel集显仍
GLSL330进阶 GeometryShader,爆炸碎片化 几何着色器Geometryshader是在顶点着色器vertex shader之后的阶段,在fragmentshader之前gs是对每个几何图元,做处理,还可以进行顶点的生成。据说用GS的话,会比较慢,原因不清楚。我用的还好在使用gs,vs的out 即为gs的in,gs的out为fs的in。在使用gs时,有几个值得注意的地方一,要指定输入 输出的图元。layout(tria
GLSL方法 构造矩阵 //powered by OpenTKmat4 scale(float x, float y, float z){ return mat4( x,0,0,0, 0,y,0,0, 0,0,z,0, 0,0,0,1 );}mat4 translate(float x, float y, float z){ return mat4( 1,0,0,0,
三角形与射线相交 一.神奇的公式有平面三角形点v0,v1,v2。p为该平面上的点则有其中u为三角形一边的比例,v为三角形另一边的比例,v0 + (v1 - v0) * u + (v2 - v0) * v = p根据方程解u v。之前有一个疑问,为什么一条公式可以解两个未知数?其实这是两条方程,平面向量有x y两个方向,这就可以解。方程的解有三类,有多解 无解 唯一解。当三角形为一条线
gl_FragCoord的xyzw gl_FragCoord.xy代表屏幕的坐標,以分辨率800*600為例窗口,左下角(0,0) Windows(0,600)。則gl_FragCoord.xy為vec2(0.5,0.5);右上角(1,1) windows(800,0),則gl_FragCoord.xy為vec2(799.5,599.5)。gl_FragCoord.z 為非線性範圍[0,1]。是從[znear,zfar]映射
WPF利用MediaFoundation打开摄像头捕捉图片 主要代码 以同步的方式获得帧REM MediaFoundation的.net 类库 http://mfnet.sourceforge.netImports MediaFoundationImports System.Runtime.InteropServicesImports System.IOImports System.DrawingImports System.Drawing.
GDI+双缓冲解决闪屏 文件夹选择目录 遍历文件夹 不多说,直接上Win32 VC++代码///FrameCPP.h///#pragma once#include "resource.h"#include #include #include #include #include #pragma comment(lib, "comctl32.lib") #pragma comment(lib, "gdiplus.lib"