* do the following for each edge (vertex pair) in a mesh:
* start with a vertex (in "object space") from the .obj file
* translate/rotate/scale the vertex in any combination of
R/S/T: this puts it in "world space" (use matrices to
do the R/S/T). Note that rotation is about an arbitrary
axis for a given angle (the rotation axis is centered at origin)
* create a cam matrix by translating the camera once and
rotating it about X/Y/Z in any arbitrary sequence; transform the
world space point using this, which puts the point in "camera space"
* create a perspective matrix using near/far/top/bottom/right/left,
transform the cam space point with it to get point in NDC space (2D space)
* convert the NDC coords (usually -1.0 to 1.0) to integer pixel coords between
(0,0) and (xres-1,yres-1) using simple scaling and adding- this gives you
"pixel space" coords ready for line drawing
* now that you have the edge endpoints in "pixel space", draw a line between them
* repeat above for each edge - result is a wireframe rendering of your mesh
Cube, straight-on:
Polymesh has 12 edges..
Point A: -0.5 -0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 -0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.8333333333 -0.8333333333 -3.666666667
Point B: 0.5 -0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 -0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.8333333333 -0.8333333333 -3.666666667
Edge, NDC coords: -0.8333333333 -0.8333333333, 0.8333333333 -0.8333333333
Edge, pixel coords: 41 41, 457 41
Point A: -0.5 0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.8333333333 0.8333333333 -3.666666667
Point B: 0.5 0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.8333333333 0.8333333333 -3.666666667
Edge, NDC coords: -0.8333333333 0.8333333333, 0.8333333333 0.8333333333
Edge, pixel coords: 41 457, 457 457
Point A: -0.5 0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.3125 0.3125 0.5
Point B: 0.5 0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.3125 0.3125 0.5
Edge, NDC coords: -0.3125 0.3125, 0.3125 0.3125
Edge, pixel coords: 171 327, 327 327
Point A: -0.5 -0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 -0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.3125 -0.3125 0.5
Point B: 0.5 -0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 -0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.3125 -0.3125 0.5
Edge, NDC coords: -0.3125 -0.3125, 0.3125 -0.3125
Edge, pixel coords: 171 171, 327 171
Point A: -0.5 -0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 -0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.8333333333 -0.8333333333 -3.666666667
Point B: -0.5 0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.8333333333 0.8333333333 -3.666666667
Edge, NDC coords: -0.8333333333 -0.8333333333, -0.8333333333 0.8333333333
Edge, pixel coords: 41 41, 41 457
Point A: 0.5 -0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 -0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.8333333333 -0.8333333333 -3.666666667
Point B: 0.5 0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.8333333333 0.8333333333 -3.666666667
Edge, NDC coords: 0.8333333333 -0.8333333333, 0.8333333333 0.8333333333
Edge, pixel coords: 457 41, 457 457
Point A: -0.5 0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.8333333333 0.8333333333 -3.666666667
Point B: -0.5 0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.3125 0.3125 0.5
Edge, NDC coords: -0.8333333333 0.8333333333, -0.3125 0.3125
Edge, pixel coords: 41 457, 171 327
Point A: 0.5 0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.8333333333 0.8333333333 -3.666666667
Point B: 0.5 0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.3125 0.3125 0.5
Edge, NDC coords: 0.8333333333 0.8333333333, 0.3125 0.3125
Edge, pixel coords: 457 457, 327 327
Point A: -0.5 0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.3125 0.3125 0.5
Point B: -0.5 -0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 -0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.3125 -0.3125 0.5
Edge, NDC coords: -0.3125 0.3125, -0.3125 -0.3125
Edge, pixel coords: 171 327, 171 171
Point A: 0.5 0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.3125 0.3125 0.5
Point B: 0.5 -0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 -0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.3125 -0.3125 0.5
Edge, NDC coords: 0.3125 0.3125, 0.3125 -0.3125
Edge, pixel coords: 327 327, 327 171
Point A: -0.5 -0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 -0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.3125 -0.3125 0.5
Point B: -0.5 -0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: -0.5 -0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): -0.8333333333 -0.8333333333 -3.666666667
Edge, NDC coords: -0.3125 -0.3125, -0.8333333333 -0.8333333333
Edge, pixel coords: 171 171, 41 41
Point A: 0.5 -0.5 -0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 -0.5 -1.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.3125 -0.3125 0.5
Point B: 0.5 -0.5 0.5
Point after world_to_cam, cam at 0,0,1.1: 0.5 -0.5 -0.6
Point after cam_to_persp using 1,2,-1,1-1,1(x,y,z shown divided by 'w'): 0.8333333333 -0.8333333333 -3.666666667
Edge, NDC coords: 0.3125 -0.3125, 0.8333333333 -0.8333333333
Edge, pixel coords: 327 171, 457 41
Cube, tilted:
Polymesh has 12 edges..
Point A: -0.5 -0.5 0.5
Point after being rotated about X by 0.6 radians: -0.5 -0.1303465708 0.6949890442
Point after being rotated about Y by 0.3 radians: -0.6830515505 -0.1303465708 0.5161882901
Point after being rotated about Z by 0.7 radians: -0.6063982083 0.3403393339 0.5161882901
Point after world_to_cam, cam at 0,0,1: -0.6063982083 0.3403393339 -0.4838117099
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -1.25337646 0.703454106 -5.267679178
Point B: 0.5 -0.5 0.5
Point after being rotated about X by 0.6 radians: 0.5 -0.1303465708 0.6949890442
Point after being rotated about Y by 0.3 radians: 0.2722849386 -0.1303465708 0.8117084968
Point after being rotated about Z by 0.7 radians: 0.1242834417 -0.2751053297 0.8117084968
Point after world_to_cam, cam at 0,0,1: 0.1242834417 -0.2751053297 -0.1882915032
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 0.660058683 -1.461060775 -18.24365641
Edge, NDC coords: -1.25337646 0.703454106, 0.660058683 -1.461060775
Edge, pixel coords: -63 425, 414 -115
Point A: -0.5 0.5 0.5
Point after being rotated about X by 0.6 radians: -0.5 0.6949890442 0.1303465708
Point after being rotated about Y by 0.3 radians: -0.5161882901 0.6949890442 -0.02323526805
Point after being rotated about Z by 0.7 radians: 0.05292165384 0.8640945671 -0.02323526805
Point after world_to_cam, cam at 0,0,1: 0.05292165384 0.8640945671 -1.023235268
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 0.05171992746 0.8444730103 -0.9091694011
Point B: 0.5 0.5 0.5
Point after being rotated about X by 0.6 radians: 0.5 0.6949890442 0.1303465708
Point after being rotated about Y by 0.3 radians: 0.439148199 0.6949890442 0.2722849386
Point after being rotated about Z by 0.7 radians: 0.7836033038 0.2486499035 0.2722849386
Point after world_to_cam, cam at 0,0,1: 0.7836033038 0.2486499035 -0.7277150614
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 1.076799623 0.3416858008 -2.496656882
Edge, NDC coords: 0.05171992746 0.8444730103, 1.076799623 0.3416858008
Edge, pixel coords: 262 460, 518 334
Point A: -0.5 0.5 -0.5
Point after being rotated about X by 0.6 radians: -0.5 0.1303465708 -0.6949890442
Point after being rotated about Y by 0.3 radians: -0.2722849386 0.1303465708 -0.8117084968
Point after being rotated about Z by 0.7 radians: -0.1242834417 0.2751053297 -0.8117084968
Point after world_to_cam, cam at 0,0,1: -0.1242834417 0.2751053297 -1.811708497
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -0.0686001318 0.1518485618 0.7921392944
Point B: 0.5 0.5 -0.5
Point after being rotated about X by 0.6 radians: 0.5 0.1303465708 -0.6949890442
Point after being rotated about Y by 0.3 radians: 0.6830515505 0.1303465708 -0.5161882901
Point after being rotated about Z by 0.7 radians: 0.6063982083 -0.3403393339 -0.5161882901
Point after world_to_cam, cam at 0,0,1: 0.6063982083 -0.3403393339 -1.51618829
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 0.3999491437 -0.2244703617 0.3618052414
Edge, NDC coords: -0.0686001318 0.1518485618, 0.3999491437 -0.2244703617
Edge, pixel coords: 232 287, 349 193
Point A: -0.5 -0.5 -0.5
Point after being rotated about X by 0.6 radians: -0.5 -0.6949890442 -0.1303465708
Point after being rotated about Y by 0.3 radians: -0.439148199 -0.6949890442 -0.2722849386
Point after being rotated about Z by 0.7 radians: -0.7836033038 -0.2486499035 -0.2722849386
Point after world_to_cam, cam at 0,0,1: -0.7836033038 -0.2486499035 -1.272284939
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -0.6159023659 -0.1954357047 -0.1439498171
Point B: 0.5 -0.5 -0.5
Point after being rotated about X by 0.6 radians: 0.5 -0.6949890442 -0.1303465708
Point after being rotated about Y by 0.3 radians: 0.5161882901 -0.6949890442 0.02323526805
Point after being rotated about Z by 0.7 radians: -0.05292165384 -0.8640945671 0.02323526805
Point after world_to_cam, cam at 0,0,1: -0.05292165384 -0.8640945671 -0.9767647319
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -0.05418055352 -0.8846496386 -1.095151953
Edge, NDC coords: -0.6159023659 -0.1954357047, -0.05418055352 -0.8846496386
Edge, pixel coords: 95 200, 235 28
Point A: -0.5 -0.5 0.5
Point after being rotated about X by 0.6 radians: -0.5 -0.1303465708 0.6949890442
Point after being rotated about Y by 0.3 radians: -0.6830515505 -0.1303465708 0.5161882901
Point after being rotated about Z by 0.7 radians: -0.6063982083 0.3403393339 0.5161882901
Point after world_to_cam, cam at 0,0,1: -0.6063982083 0.3403393339 -0.4838117099
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -1.25337646 0.703454106 -5.267679178
Point B: -0.5 0.5 0.5
Point after being rotated about X by 0.6 radians: -0.5 0.6949890442 0.1303465708
Point after being rotated about Y by 0.3 radians: -0.5161882901 0.6949890442 -0.02323526805
Point after being rotated about Z by 0.7 radians: 0.05292165384 0.8640945671 -0.02323526805
Point after world_to_cam, cam at 0,0,1: 0.05292165384 0.8640945671 -1.023235268
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 0.05171992746 0.8444730103 -0.9091694011
Edge, NDC coords: -1.25337646 0.703454106, 0.05171992746 0.8444730103
Edge, pixel coords: -63 425, 262 460
Point A: 0.5 -0.5 0.5
Point after being rotated about X by 0.6 radians: 0.5 -0.1303465708 0.6949890442
Point after being rotated about Y by 0.3 radians: 0.2722849386 -0.1303465708 0.8117084968
Point after being rotated about Z by 0.7 radians: 0.1242834417 -0.2751053297 0.8117084968
Point after world_to_cam, cam at 0,0,1: 0.1242834417 -0.2751053297 -0.1882915032
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 0.660058683 -1.461060775 -18.24365641
Point B: 0.5 0.5 0.5
Point after being rotated about X by 0.6 radians: 0.5 0.6949890442 0.1303465708
Point after being rotated about Y by 0.3 radians: 0.439148199 0.6949890442 0.2722849386
Point after being rotated about Z by 0.7 radians: 0.7836033038 0.2486499035 0.2722849386
Point after world_to_cam, cam at 0,0,1: 0.7836033038 0.2486499035 -0.7277150614
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 1.076799623 0.3416858008 -2.496656882
Edge, NDC coords: 0.660058683 -1.461060775, 1.076799623 0.3416858008
Edge, pixel coords: 414 -115, 518 334
Point A: -0.5 0.5 0.5
Point after being rotated about X by 0.6 radians: -0.5 0.6949890442 0.1303465708
Point after being rotated about Y by 0.3 radians: -0.5161882901 0.6949890442 -0.02323526805
Point after being rotated about Z by 0.7 radians: 0.05292165384 0.8640945671 -0.02323526805
Point after world_to_cam, cam at 0,0,1: 0.05292165384 0.8640945671 -1.023235268
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 0.05171992746 0.8444730103 -0.9091694011
Point B: -0.5 0.5 -0.5
Point after being rotated about X by 0.6 radians: -0.5 0.1303465708 -0.6949890442
Point after being rotated about Y by 0.3 radians: -0.2722849386 0.1303465708 -0.8117084968
Point after being rotated about Z by 0.7 radians: -0.1242834417 0.2751053297 -0.8117084968
Point after world_to_cam, cam at 0,0,1: -0.1242834417 0.2751053297 -1.811708497
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -0.0686001318 0.1518485618 0.7921392944
Edge, NDC coords: 0.05171992746 0.8444730103, -0.0686001318 0.1518485618
Edge, pixel coords: 262 460, 232 287
Point A: 0.5 0.5 0.5
Point after being rotated about X by 0.6 radians: 0.5 0.6949890442 0.1303465708
Point after being rotated about Y by 0.3 radians: 0.439148199 0.6949890442 0.2722849386
Point after being rotated about Z by 0.7 radians: 0.7836033038 0.2486499035 0.2722849386
Point after world_to_cam, cam at 0,0,1: 0.7836033038 0.2486499035 -0.7277150614
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 1.076799623 0.3416858008 -2.496656882
Point B: 0.5 0.5 -0.5
Point after being rotated about X by 0.6 radians: 0.5 0.1303465708 -0.6949890442
Point after being rotated about Y by 0.3 radians: 0.6830515505 0.1303465708 -0.5161882901
Point after being rotated about Z by 0.7 radians: 0.6063982083 -0.3403393339 -0.5161882901
Point after world_to_cam, cam at 0,0,1: 0.6063982083 -0.3403393339 -1.51618829
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 0.3999491437 -0.2244703617 0.3618052414
Edge, NDC coords: 1.076799623 0.3416858008, 0.3999491437 -0.2244703617
Edge, pixel coords: 518 334, 349 193
Point A: -0.5 0.5 -0.5
Point after being rotated about X by 0.6 radians: -0.5 0.1303465708 -0.6949890442
Point after being rotated about Y by 0.3 radians: -0.2722849386 0.1303465708 -0.8117084968
Point after being rotated about Z by 0.7 radians: -0.1242834417 0.2751053297 -0.8117084968
Point after world_to_cam, cam at 0,0,1: -0.1242834417 0.2751053297 -1.811708497
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -0.0686001318 0.1518485618 0.7921392944
Point B: -0.5 -0.5 -0.5
Point after being rotated about X by 0.6 radians: -0.5 -0.6949890442 -0.1303465708
Point after being rotated about Y by 0.3 radians: -0.439148199 -0.6949890442 -0.2722849386
Point after being rotated about Z by 0.7 radians: -0.7836033038 -0.2486499035 -0.2722849386
Point after world_to_cam, cam at 0,0,1: -0.7836033038 -0.2486499035 -1.272284939
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -0.6159023659 -0.1954357047 -0.1439498171
Edge, NDC coords: -0.0686001318 0.1518485618, -0.6159023659 -0.1954357047
Edge, pixel coords: 232 287, 95 200
Point A: 0.5 0.5 -0.5
Point after being rotated about X by 0.6 radians: 0.5 0.1303465708 -0.6949890442
Point after being rotated about Y by 0.3 radians: 0.6830515505 0.1303465708 -0.5161882901
Point after being rotated about Z by 0.7 radians: 0.6063982083 -0.3403393339 -0.5161882901
Point after world_to_cam, cam at 0,0,1: 0.6063982083 -0.3403393339 -1.51618829
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 0.3999491437 -0.2244703617 0.3618052414
Point B: 0.5 -0.5 -0.5
Point after being rotated about X by 0.6 radians: 0.5 -0.6949890442 -0.1303465708
Point after being rotated about Y by 0.3 radians: 0.5161882901 -0.6949890442 0.02323526805
Point after being rotated about Z by 0.7 radians: -0.05292165384 -0.8640945671 0.02323526805
Point after world_to_cam, cam at 0,0,1: -0.05292165384 -0.8640945671 -0.9767647319
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -0.05418055352 -0.8846496386 -1.095151953
Edge, NDC coords: 0.3999491437 -0.2244703617, -0.05418055352 -0.8846496386
Edge, pixel coords: 349 193, 235 28
Point A: -0.5 -0.5 -0.5
Point after being rotated about X by 0.6 radians: -0.5 -0.6949890442 -0.1303465708
Point after being rotated about Y by 0.3 radians: -0.439148199 -0.6949890442 -0.2722849386
Point after being rotated about Z by 0.7 radians: -0.7836033038 -0.2486499035 -0.2722849386
Point after world_to_cam, cam at 0,0,1: -0.7836033038 -0.2486499035 -1.272284939
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -0.6159023659 -0.1954357047 -0.1439498171
Point B: -0.5 -0.5 0.5
Point after being rotated about X by 0.6 radians: -0.5 -0.1303465708 0.6949890442
Point after being rotated about Y by 0.3 radians: -0.6830515505 -0.1303465708 0.5161882901
Point after being rotated about Z by 0.7 radians: -0.6063982083 0.3403393339 0.5161882901
Point after world_to_cam, cam at 0,0,1: -0.6063982083 0.3403393339 -0.4838117099
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -1.25337646 0.703454106 -5.267679178
Edge, NDC coords: -0.6159023659 -0.1954357047, -1.25337646 0.703454106
Edge, pixel coords: 95 200, -63 425
Point A: 0.5 -0.5 -0.5
Point after being rotated about X by 0.6 radians: 0.5 -0.6949890442 -0.1303465708
Point after being rotated about Y by 0.3 radians: 0.5161882901 -0.6949890442 0.02323526805
Point after being rotated about Z by 0.7 radians: -0.05292165384 -0.8640945671 0.02323526805
Point after world_to_cam, cam at 0,0,1: -0.05292165384 -0.8640945671 -0.9767647319
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): -0.05418055352 -0.8846496386 -1.095151953
Point B: 0.5 -0.5 0.5
Point after being rotated about X by 0.6 radians: 0.5 -0.1303465708 0.6949890442
Point after being rotated about Y by 0.3 radians: 0.2722849386 -0.1303465708 0.8117084968
Point after being rotated about Z by 0.7 radians: 0.1242834417 -0.2751053297 0.8117084968
Point after world_to_cam, cam at 0,0,1: 0.1242834417 -0.2751053297 -0.1882915032
Point after cam_to_persp using 1,2,-1,1,-1,1 (after dividing by 'w'): 0.660058683 -1.461060775 -18.24365641
Edge, NDC coords: -0.05418055352 -0.8846496386, 0.660058683 -1.461060775
Edge, pixel coords: 235 28, 414 -115