MAXON CINEMA 4D: Cinema 4D Forum Adobe After Effects Forum

Converting 3D Points to Screen Space X&Y in Python

COW Forums : Maxon Cinema 4D

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Kevin C. Burke
Converting 3D Points to Screen Space X&Y in Python
on Jul 28, 2018 at 11:57:10 pm

Hello,
I'm trying to get the X&Y pixel coordinates of my polygon plane's vertices. The output dimensions are 4096x2160 pixels (attached). These are the plane's 3D vectors followed by the pixel coordinates I'm looking to get:
# Top Left Corner: (-200,200,0) -> 1493,505
# Top Right Corner: (200,200,0) -> 2458,471
# Bottom Left Corner: (-200,-200,0) -> 1524,1712
# Bottom Right Corner: (200,-200,0) -> 2438,1509


Does anyone know how can I do this in Python? I've tried to us BaseDraw's WC, CS, WS, and WC_V methods, but I'm not sure what to do with their results (which are not in pixels).
WC: Vector(-174.873, 181.224, 1288.966) # Top Left Corner
WC then CS: Vector(472.901, 423.506, 1288.966) # Top Left Corner
WS: Vector(472.901, 423.506, 1288.966) # Top Left Corner
WC_V: Vector(-163.448, 174.118, -151.55) # Top Left Corner
CS: Vector(-25959351, -25959394, 0),Vector(25960649, -25959394, 0),Vector(25960649, 25960606, 0),Vector(-25959351, 25960606, 0) # All four vertices


Thank you.



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]