A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
Converting 3D Points to Screen Space X&Y with Python
Posted: 28 July 2018 11:25 PM   [ Ignore ]  
Avatar
Total Posts:  80
Joined  2012-05-01

Hello,

I’m trying to get the X&Y pixel coordinates of my polygon plane’s vertices. 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 

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).

WCVector(-174.873181.2241288.966# Top Left Corner
WC then CSVector(472.901423.5061288.966# Top Left Corner
WSVector(472.901423.5061288.966# Top Left Corner
WC_VVector(-163.448174.118, -151.55# Top Left Corner
CSVector(-25959351, -259593940),Vector(25960649, -259593940),Vector(25960649259606060),Vector(-25959351259606060# All four vertices 
Profile
 
 
Posted: 29 July 2018 01:19 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi blastframe,

This would be a question for:

http://www.plugincafe.com/forum/default.asp

Where you have asked already this question a little bit earlier.

My best wishes

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 29 July 2018 01:42 AM   [ Ignore ]   [ # 2 ]  
Avatar
Total Posts:  80
Joined  2012-05-01
Dr. Sassi - 29 July 2018 01:19 AM

Hi blastframe,

This would be a question for:

http://www.plugincafe.com/forum/default.asp

Where you have asked already this question a little bit earlier.

My best wishes

Ah, my apologies and thank you for the response. I’d seen other posts about Python before I posted here.

Profile
 
 
Posted: 29 July 2018 01:54 AM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

No need to apologize, blastframe, but the best place for any first hand knowledge about C4D’s Python is the plug-in-cafe.

It is always a good idea to ask with the core target, so people can share perhaps a solution that would not fit your specific question, but might solve the problem after all.
In the past 14 years answering in a forum, many of the question were defined by the problem “in the middle”, which often would have meant to patch a problem that was not needed to begin with.

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile