OBD:PLEA: Difference between revisions
Jump to navigation
Jump to search
m (inequation) |
m (design) |
||
Line 1: | Line 1: | ||
{{OBD_File_Header | {{OBD_File_Header | type=PLEA | prev=OTLF | next=PNTA | name=Plane Equation Array | family=Level | align=center}} | ||
[[image:plea_a.gif]] | |||
{{Table}} | |||
{{OBDth}} | |||
{{OBDtr| 0x00 | res_id |FF0000| 01 41 02 00 | 577 | 00577-.PLEA }} | |||
| | {{OBDtr| 0x04 | lev_id |FFFF00| 01 00 00 06 | 3 | level 3 }} | ||
{{OBDtr| 0x08 | char[20] |00FF00| AD DE | dead | unused }} | |||
{{OBDtr| 0x1C | int32 |00FFFF| 03 00 00 00 | 13554 | array size }} | |||
{{OBDtrBK}} | |||
| | {{OBDtr| 0x00 | float |FFC8C8| 00 00 00 00 | 0.000000 | 1st coefficient of the plane equation (x-part of normal vector) }} | ||
| | {{OBDtr| 0x04 | float |FFFFC8| 00 00 00 00 | 0.000000 | 2nd coefficient of the plane equation (y-part of normal vector) }} | ||
| 577 | {{OBDtr| 0x08 | float |C8FFC8| 00 00 80 3F | 1.000000 | 3rd coefficient of the plane equation (z-part of normal vector) }} | ||
{{OBDtr| 0x0C | float |C8FFFF| 00 00 19 44 |612.000000| 4th coefficient of the plane equation }} | |||
| | |||
| | |||
| 3 | |||
| | |||
| | |||
| dead | |||
| | |||
| | |||
| 13554 | |||
| | |||
| | |||
| | |||
| | |||
| 0.000000 | |||
| | |||
| | |||
| 0.000000 | |||
| | |||
| | |||
| | |||
| 1.000000 | |||
| | |||
| | |||
| 612.000000 | |||
| | |||
|} | |} | ||
;Plane equation | ;Plane equation | ||
:The canonical equation for a [http://mathworld.wolfram.com/Plane.html plane] in 3D is : | :The canonical equation for a [http://mathworld.wolfram.com/Plane.html plane] in 3D is : | ||
Line 61: | Line 33: | ||
::It's rather easy to check (just flip the "normal" of the plane equation for a known axis-aligned quad). | ::It's rather easy to check (just flip the "normal" of the plane equation for a known axis-aligned quad). | ||
:The oriented "plane inequation" can be used for: culling; collision. | :The oriented "plane inequation" can be used for: culling; collision. | ||
{{OBD_File_Footer | type=PLEA | prev=OTLF | next=PNTA | name=Plane Equation Array | family=Level}} | |||
{{OBD_File_Header|align=center|type=PLEA|prev=OTLF|next=PNTA|name=Plane Equation Array|family=Level|onistuff=plea}} | |||
{{ |
Revision as of 09:30, 12 September 2007
|
Offset | Type | Raw Hex | Value | Description |
---|---|---|---|---|
0x00 | res_id | 01 41 02 00 | 577 | 00577-.PLEA |
0x04 | lev_id | 01 00 00 06 | 3 | level 3 |
0x08 | char[20] | AD DE | dead | unused |
0x1C | int32 | 03 00 00 00 | 13554 | array size |
First element (black outline) | ||||
0x00 | float | 00 00 00 00 | 0.000000 | 1st coefficient of the plane equation (x-part of normal vector) |
0x04 | float | 00 00 00 00 | 0.000000 | 2nd coefficient of the plane equation (y-part of normal vector) |
0x08 | float | 00 00 80 3F | 1.000000 | 3rd coefficient of the plane equation (z-part of normal vector) |
0x0C | float | 00 00 19 44 | 612.000000 | 4th coefficient of the plane equation |
- Plane equation
- The canonical equation for a plane in 3D is :
- a * x + b * y + c * z + d = 0
- where (a, b, c, d) are 4 real numbers. The plane is the set of points (x, y, z) verifying that equation.
- It is likely that the four floats in one of a PLEA's packages are exactly the (a, b, c, d) of the above definition.
- In that case, the first package of the above example defines the plane (0 * x + 0 * y + 1 * z + 612 = 0), i.e., the vertical plane z = -612.
- It is possible, however, that the definition used is different, e.g. : a * x + b * y + c * z = d .
- In that case, the first package of the above example defines the plane (0 * x + 0 * y + 1 * z = 612), i.e., the vertical plane z = 612.
- Front/back
- The 4 numbers (a, b, c, d) can also serve to define whether a 3D point (x, y, z) is on the "front" side of the plane or in the "back".
- "points are in front of the plane if a * x + b * y + c * z >= d" (from commented Myth source)
- That would mean the plane equation is a * x + b * y + c * z = d , not a * x + b * y + c * z + d = 0 .
- It's rather easy to check (just flip the "normal" of the plane equation for a known axis-aligned quad).
- The oriented "plane inequation" can be used for: culling; collision.
ONI BINARY DATA |
---|
OTLF << Other file types >> PNTA |
PLEA : Plane Equation Array |
Level file |
|