cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to get Light Source's "Lock To" setting

rkhvostikov
4-Participant

How to get Light Source's "Lock To" setting

Hi!

Via API, how do I get status if a light source is locked to Studio/Model/Camera?
ProLightInfo structure is missing such a flag.

1 ACCEPTED SOLUTION

Accepted Solutions

I got a confirmation from the support team that there is no such an API so far. I will submit an idea.

View solution in original post

5 REPLIES 5

Have you looked in "Creo Parametric TOOLKIT User’s Guide"?

Hi @rkhvostikov ,

 

is this a Creo Parametric API question? If yes , in this case I could not understand what you meant with (Studio /Model /Camera- is this AR Vuforia Studio related?

So regarding to  the structure :

 

 

 

 typedef struct pro_tk_light
 {
  wchar_t name[PRO_NAME_SIZE];
 ProLightType type;
 ProBoolean status;   /* active or inactive */
 double rgb[3]; /* for all types */
 double position[3]; /* for point and spot */
  double direction[3]; /* for direction and spot */
 double spread_angle; /* for spot, in radian */
 ProBoolean cast_shadows;
 } ProLightInfo;

 

 

defined in ProSuface.h -what means that this is more then surface appearance oriented  but not general projection related. Ok it is applied to the current Window. 

 

 

 

 ProError ProLightSourcesGet( int window_id,  ProLightInfo** light_info);
 ProError ProLightSourcesSet( int window_id,ProLightInfo* light_info);

 

 

For planar projection what is the usage in Creo Parametric there is no camera definition required. In this case we have the different transformation matrix to transform coordinates rom part to assembly ... etc. - model transform -then form model to View and Display  and in drawing to drawing coordinates  (please, see  the chapter 9 Core: Coordinate Systems and Transformations page 222 ) in the attached document in the post from @VladimirN  ->  - creo Tk user guide   

I am not sure if Toolkit API could access or set perspective projection like Web.GL e.g. https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_model_view_projection

In the past (older Creo Releases) it  was not possible for the Toolkit API to use perspective views  but I  did not check the latest releases if this is provided in the meantime. I believe it is not available but not sure

I remember only  the drawing function ProDrawingViewPerspectiveScaleGet()

The function ProDrawingViewPerspectiveScaleGet() returns the
perspective scale applied to a drawing view. This scale option is available only for
general views. The function returns the following output arguments:
• eye_dist—Specifies the eye-point distance from model space.
• view_dia—Specifies the view diameter in paper units such as mm

 But this is a drawing view related funciton. 

So the quesiton is what is the goal here. What should be achieved?

Hi @RolandRaytchev .

 

Yes, this is a Creo Parametric question.

Yes, ProLightSourcesGet() is the method to enumerate lights as in "Lights..." page of "Scene Editor" dialog. It is quite easy to verify.

 

My quess is that the position/direction returned in ProLightInfo struction relate to the current orientation of a model in a view.

But still this is not enough for us because we need to render our images with different orientation. So I need to know should I transform light coordinates to different orientation or treat it locked to eye viewpoint.

 

I got a confirmation from the support team that there is no such an API so far. I will submit an idea.

Top Tags