I want to create an object oriented matrix due to the slow speed of the built in one, yet I don\'t really understand making meshes with memblocks yet so I was wondering if anyone could help clear this up.
I found this thread created by Phaelax but didn\'t understand how he did it:
Object Matrix
So I started on my own and discovered some math behind the built in objects. Here\'s what DBC says on the commands menu when you click on make mesh from memblock
Memblock-Mesh (32 Byte Header)
-Header
--4 BYTES (DWORD) Number Of Vertices
--4 BYTES (DWORD) Offset in Bytes to Vertice Data
--4 BYTES (DWORD) Number Of Normals
--4 BYTES (DWORD) Offset in Bytes to Normals Data
--4 BYTES (DWORD) Number of Faces
--4 BYTES (DWORD) Offset in Bytes to Face Data
--4 BYTES (DWORD) Size Of All Face Data
--4 BYTES (DWORD) Offset in Bytes to Texture UV Data
-Data
--Vertice Data
---For Each Vertex
----4 BYTES (FLOAT) - X Position of 3D Geometry
----4 BYTES (FLOAT) - Y Position of 3D Geometry
----4 BYTES (FLOAT) - Z Position of 3D Geometry
--Normals Data
---For Each Normal
----4 BYTES (FLOAT) - X Normalised Normal of 3D Geometry
----4 BYTES (FLOAT) - Y Normalised Normal of 3D Geometry
----4 BYTES (FLOAT) - Z Normalised Normal of 3D Geometry
--Face Data
---For Each Face (a face makes a polygon using A,B and C as vector points)
----2 BYTES (DWORD) - Number of Vectors in Face (always use 3)
----2 BYTES (DWORD) - Index to Vertex in Vertex Data for Vector A
----2 BYTES (DWORD) - Index to Normal in Vertex Data for Vector A
----2 BYTES (DWORD) - Index to Vertex in Vertex Data for Vector B
----2 BYTES (DWORD) - Index to Normal in Vertex Data for Vector B
----2 BYTES (DWORD) - Index to Vertex in Vertex Data for Vector C
----2 BYTES (DWORD) - Index to Normal in Vertex Data for Vector C
--Texture Data
---For Each Vertex
----4 BYTES (FLOAT) - U Value of Texture
----4 BYTES (FLOAT) - V Value of Texture
So far, I\'ve figure out this much:
Memblock-Mesh (32 Byte Header)
-Header
Number Of Vertices = However many the object needs
Offset in Bytes to Vertice Data = Normally 32
Number Of Normals = Number Of Vertics
Offset in Bytes to Normals Data = Number Of Normals*12+Offset in Bytes to Vertice Data
Number of Faces = However many the object needs
Offset in Bytes to Face Data = Number of Normals*12 + Offset in Bytes to Normals Data
Size Of All Face Data = Number of Faces*7
Offset in Bytes to Texture UV Data = Size Of All Face Data*4 + Offset in Bytes to Face Data
Dont get me wrong, I\'m not even sure if this is right. Any help is greatly appreciated