mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-02-16 17:35:39 +00:00
top/bottom were swapped for off axis projection
This commit is contained in:
parent
6efa03112e
commit
d708ce9ba2
|
@ -757,12 +757,10 @@ void CNew3D::RenderViewport(UINT32 addr)
|
|||
|
||||
m_LODBlendTable = (LODBlendTable*)TranslateCullingAddress(vpnode[0x17] & 0xFFFFFF);
|
||||
|
||||
/*
|
||||
vp->angle_left = -atan2(*(float *)&vpnode[12], *(float *)&vpnode[13]); // These values work out as the normals for the clipping planes.
|
||||
vp->angle_right = atan2(*(float *)&vpnode[16], -*(float *)&vpnode[17]); // Sometimes these values (dirt devils,lost world) are totally wrong
|
||||
vp->angle_top = atan2(*(float *)&vpnode[14], *(float *)&vpnode[15]); // and don't work for the frustum values exactly.
|
||||
vp->angle_bottom = -atan2(*(float *)&vpnode[18], -*(float *)&vpnode[19]); // Perhaps they are just used for culling and not rendering.
|
||||
*/
|
||||
|
||||
float cv = *(float *)&vpnode[0x8]; // 1/tan(left-right)
|
||||
float cw = *(float *)&vpnode[0x9]; // 1/tan(top-bottom)
|
||||
|
@ -771,8 +769,8 @@ void CNew3D::RenderViewport(UINT32 addr)
|
|||
|
||||
float left = (1.0f / cv) * (0.0f - jo);
|
||||
float right = (1.0f / cv) * (1.0f - jo);
|
||||
float bottom = (1.0f / cw) * (0.0f - io);
|
||||
float top = (1.0f / cw) * (1.0f - io);
|
||||
float bottom = (1.0f / cw) * -(1.0f - io);
|
||||
float top = (1.0f / cw) * -(0.0f - io);
|
||||
|
||||
vp->angle_left = std::atan(left); // probably could skip atan
|
||||
vp->angle_right = std::atan(right);
|
||||
|
|
Loading…
Reference in a new issue