Author Topic: BSP_Data: How the hell does it work?  (Read 714 times)

0 Members and 1 Guest are viewing this topic.

Offline Kiloku

  • 27
  • I try to make games, but nothing releasable yet.
    • Minecraft
BSP_Data: How the hell does it work?
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 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?



Offline The E

  • He's Ebeneezer Goode
  • Global Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: BSP_Data: How the hell does it work?
Point and vector data is always a set of three floats, in xyz order.
Let there be light
Let there be moon
Let there be stars and let there be you
Let there be monsters and let there be pain
Let us begin to feel again
--Devin Townsend, Genesis