|

提醒:若下载的软件是收费的"请不要付款",可能是骗子,请立即联系本站举报,执意要付款被骗后本站概不负责。(任何交易请走第三方中介,请勿直接付款交易以免被骗!切记).
某游戏会对此系统“D3DXVec3Project”API下钩子实时检测或由此API对三无产品软件调用此API进行三维世界坐标转二维屏幕坐标时进行特征并且上传后台导致莫名其妙拉闸,故此为广大E++道友开源下 别拿去圈钱哦~
相关资料参考:https://wenku.baidu.com/view/7769948c5aeef8c75fbfc77da26925c52cc591ca.html
C#源码:参考一:
```csharp
using System.Numerics;
public struct Vector3
{
public float X, Y, Z;
public Vector3(float x, float y, float z)
{
X = x;
Y = y;
Z = z;
}
public static Vector3 operator *(Vector3 vector, Matrix4x4 matrix)
{
return new Vector3(
(vector.X * matrix.M11 + vector.Y * matrix.M21 + vector.Z * matrix.M31 + 1 * matrix.M41),
(vector.X * matrix.M12 + vector.Y * matrix.M22 + vector.Z * matrix.M32 + 1 * matrix.M42),
(vector.X * matrix.M13 + vector.Y * matrix.M23 + vector.Z * matrix.M33 + 1 * matrix.M43)
);
}
}
public struct Matrix4x4
{
public float M11, M12, M13, M14;
public float M21, M22, M23, M24;
public float M31, M32, M33, M34;
public float M41, M42, M43, M44;
// Constructor and other methods would be defined here...
}
public class MatrixOperations
{
public static Matrix4x4 Multiply(Matrix4x4 left, Matrix4x4 right)
{
return new Matrix4x4()
{
M11 = left.M11 * right.M11 + left.M12 * right.M21 + left.M13 * right.M31 + left.M14 * right.M41,
M12 = left.M11 * right.M12 + left.M12 * right.M22 + left.M13 * right.M32 + left.M14 * right.M42,
M13 = left.M11 * right.M13 + left.M12 * right.M23 + left.M13 * right.M33 + left.M14 * right.M43,
M14 = left.M11 * right.M14 + left.M12 * right.M24 + left.M13 * right.M34 + left.M14 * right.M44,
M21 = left.M21 * right.M11 + left.M22 * right.M21 + left.M23 * right.M31 + left.M24 * right.M41,
M22 = left.M21 * right.M12 + left.M22 * right.M22 + left.M23 * right.M32 + left.M24 * right.M42,
M23 = left.M21 * right.M13 + left.M22 * right.M23 + left.M23 * right.M33 + left.M24 * right.M43,
M24 = left.M21 * right.M14 + left.M22 * right.M24 + left.M23 * right.M34 + left.M24 * right.M44,
M31 = left.M31 * right.M11 + left.M32 * right.M21 + left.M33 * right.M31 + left.M34 * right.M41,
M32 = left.M31 * right.M12 + left.M32 * right.M22 + left.M33 * right.M32 + left.M34 * right.M42,
M33 = left.M31 * right.M13 + left.M32 * right.M23 + left.M33 * right.M33 + left.M34 * right.M43,
M34 = left.M31 * right.M14 + left.M32 * right.M24 + left.M33 * right.M34 + left.M34 * right.M44,
M41 = left.M41 * right.M11 + left.M42 * right.M21 + left.M43 * right.M31 + left.M44 * right.M41,
M42 = left.M41 * right.M12 + left.M42 * right.M22 + left.M43 * right.M32 + left.M44 * right.M42,
M43 = left.M41 * right.M13 + left.M42 * right.M23 + left.M43 * right.M33 + left.M44 * right.M43,
M44 = left.M41 * right.M14 + left.M42 * right.M24 + left.M43 * right.M34 + left.M44 * right.M44,
};
}
}
public static Vector3 ProjectPoint(Vector3 point, Matrix world, Matrix view, Matrix projection, int viewportWidth, int viewportHeight)
{
Matrix combinedMatrix = world * view * projection;
Vector3 transformedPoint = point * combinedMatrix;
// 透视除法
float oneOverW = 1.0f / transformedPoint.Z;
Vector3 screenPoint = new Vector3(
transformedPoint.X * oneOverW,
transformedPoint.Y * oneOverW,
transformedPoint.Z * oneOverW
);
// 转换到视口坐标
screenPoint.X = screenPoint.X * (viewportWidth / 2) + viewportWidth / 2;
screenPoint.Y = -screenPoint.Y * (viewportHeight / 2) + viewportHeight / 2; // 注意Y轴的翻转
return screenPoint;
}
}
这里的`Vector3`和`Matrix4x4`结构体以及相关的运算符重载和方法都是简化的版本
E没有相对应的库只能构造一个`Vector3`和`Matrix4x4`类型两份C源码+一份E纯源码都在文件里哦
矩阵相乘 回帖查看密码哦→
客官刮一刮→系统内核交流群:398897142 或768047245有兴趣一起交流技术~
纯源码文件下载→
易语言D3DXVec3Project运算纯源码.rar
(21.47 KB, 下载次数: 82, 售价: 8 海币)
联系我时,请说是在 挂海论坛 上看到的,谢谢! |
上一篇: JD_30.1.2.1最全解密分享下一篇: 旧容颜联系方式谁有
免责声明:
1、本主题所有言论和图片纯属会员个人意见,与本论坛立场无关。一切关于该内容及资源商业行为与www.52ghai.com无关。
2、本站提供的一切资源内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。
3、本站信息来自第三方用户,非本站自制,版权归原作者享有,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。
4、如果您喜欢该程序,请支持正版,购买注册,得到更好的正版服务。如有侵犯你版权的,请邮件与我们联系删除(邮箱:xhzlw@foxmail.com),本站将立即改正。
|