相关疑难解决方法(0)

如何从头开始用人类可读的角度组成旋转矩阵?

总是阻碍我做3D编程的一件事是无法理解数学是如何工作的.我可以使用方法和函数在编程流程中使用数学,然后它对我来说都是清晰和合乎逻辑的,但在数学符号中,我无法从它做出正面或反面.

我一直在阅读网站,观看研究所试图解释这个问题的视频,但他们都使用数学符号,我只是迷失在其中,我的思想不会将其转化为可理解的东西.我可能有缺陷.

另外,只是使用某人的代码不是我的兴趣,我想了解它背后的机制,逻辑.我很乐意使用其他人的代码,但我真的想了解它是如何工作的.

这个问题

你能用简单的术语向我解释没有数学符号,只是编程符号/函数/伪代码,如何沿所有3轴实现矩阵变换?

理想情况下我想要的是编写方法/对象的材料/理解,我可以在其中定义3个轴的角度,类似于glRotate,以旋转我所拥有的四边形/三角形的集合.(我正在尝试编写立方体形状的3D旋转而无需访问OpenGL函数来为我执行此操作,因为每次在显示列表中发生更改时,都会在一次绘制调用中完成.)

我做了什么?

我试图制作一个90度的变换函数来获得数学的悬念,但是在制作一个理论上最简单的矩阵时却完全失败了.你可以在http://jsfiddle.net/bLfg0tj8/5/看到我失败的尝试.

Vec3 = function(x,y,z) {
    this.x = x;
    this.y = y;
    this.z = z;
}
Matrix = function Matrix() {
    this.matrixPoints = new Array();    
    this.rotationPoint = new Vec3(0,0,0);
    this.rotationAngle = 90;
}
Matrix.prototype.addVector = function(vector) {
    this.matrixPoints.push(vector);
}
Matrix.prototype.setRotationPoint = function(vector) {
    this.rotationPoint = vector; 
}
Matrix.prototype.setRotationAngle = function(angle) {
    this.rotationAngle = angle;
}
Matrix.prototype.populate = function() {
    translateToOrigin =     [[1,0,0-this.rotationPoint.x],
                                  [0,1,0-this.rotationPoint.y],
                                  [0,0,0-this.rotationPoint.z]];
    rotationMatrix =         [[0,-1,0],
                                  [0,1,0],
                                  [0,0,1]];
    translateEnd …
Run Code Online (Sandbox Code Playgroud)

opengl math 3d matrix

23
推荐指数
1
解决办法
6941
查看次数

C linux相当于windows QueryPerformanceCounter

Linux中是否有等效的C函数来读取CPU计数器及其频率?

我正在寻找一些类似于QueryPerformanceCounter函数的函数,该函数读取现代CPU中的64位计数器

c linux cpu winapi

18
推荐指数
3
解决办法
1万
查看次数

智能手机GPS定位算法研究

我正在开发一个Android应用程序来根据传感器的数据计算位置

  1. 加速度计 - >计算线性加速度

  2. 磁力计+加速度计 - >运动方向

初始位置将取自GPS(纬度+经度).

现在根据传感器的读数,我需要计算智能手机的新位置:

我的算法遵循 - (但不计算准确位置):请帮助我改进它.

注意: 我的算法代码在C#中(我将传感器数据发送到服务器 - 数据存储在数据库中.我正在计算服务器上的位置)

所有DateTime对象都是使用TimeStamps计算的 - 从01-01-1970

    var prevLocation = ServerHandler.getLatestPosition(IMEI);
    var newLocation = new ReceivedDataDTO()
                          {
                              LocationDataDto = new LocationDataDTO(),
                              UsersDto = new UsersDTO(),
                              DeviceDto = new DeviceDTO(),
                              SensorDataDto = new SensorDataDTO()
                          };

    //First Reading
    if (prevLocation.Latitude == null)
    {
        //Save GPS Readings
        newLocation.LocationDataDto.DeviceId = ServerHandler.GetDeviceIdByIMEI(IMEI);
        newLocation.LocationDataDto.Latitude = Latitude;
        newLocation.LocationDataDto.Longitude = Longitude;
        newLocation.LocationDataDto.Acceleration = float.Parse(currentAcceleration);
        newLocation.LocationDataDto.Direction = float.Parse(currentDirection);
        newLocation.LocationDataDto.Speed = (float) 0.0;
        newLocation.LocationDataDto.ReadingDateTime = date;
        newLocation.DeviceDto.IMEI = …
Run Code Online (Sandbox Code Playgroud)

c# algorithm gps android android-sensors

10
推荐指数
2
解决办法
8929
查看次数

标签 统计

3d ×1

algorithm ×1

android ×1

android-sensors ×1

c ×1

c# ×1

cpu ×1

gps ×1

linux ×1

math ×1

matrix ×1

opengl ×1

winapi ×1