Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Kiloku on March 10, 2019, 10:20:40 pm

Title: BSP_Data: How the hell does it work?
Post by: Kiloku on March 10, 2019, 10:20:40 pm
I'm trying to render a .POF object in Unity3D.

I can already load the .POF info (from a VP file) into memory. I've read about the .POF format, the OBJ2 chunk, etc.

I'm stuck when I hit the BSP_Data. I read this (https://wiki.hard-light.net/index.php/Bsp_data_structure) documentation, but I still need help understanding it.

In a DEFPoints block, for example, theres this
Code: [Select]
+offset vertex_data // Each vertex n is a point followed by norm_counts[n] normals.

Which (if I understood correctly) says that I have to jump to the byte numbered +offset to start reading the vertex_data (after I read the other values, including offset itself.
But what type is vertex_data? I see "each vertex is a point". What is a point? A set of 3 integers x,y,z?
Then it's followed by norm_counts[n] normals, but I ask the same question: What format are these normals in? Are they 3 axis vectors?

Title: Re: BSP_Data: How the hell does it work?
Post by: The E on March 11, 2019, 12:27:45 am
Point and vector data is always a set of three floats, in xyz order.