Page 1 of 1

Camera postion

Posted: Thu Oct 12, 2017 9:02 am
by Felguf
Hello,

Is there a way to have the camera (eye) position, a global up vector and a target point of the view of my model in GiD.

Is-it possible to retrieve theses values from the GiD_Info view function or informations in the *.vv file. Or is there another function / way ?

Regards,

Yves

Re: Camera postion

Posted: Fri Oct 13, 2017 3:24 pm
by escolano
For 'orthogonal projection' (the useful GiD representation mode) it only matter the visual projection direction.
(in conical 'perspective projection' the rays are not parallel and then there is not a constant 'projection direction', it is necessary to know the apex of the cone where the camera is located)

The 'camera direction' information is implicit in the transform matrix 4x4 (m 'item') returned by
GiD_Info view

In next GiD 13.1.9d developer version (available soon) the GiD_Info view is replaced by a new Tcl command
GiD_Project view <option> ?<value>?
this command is similar to GiD_Info view, but allow not only ask by the values, but also set them, and it also allow the access to each individual item
e.g. for the old 'm' item you will use:
GiD_Project view rotation_matrix
(the old command GiD_Info view won't be deleted, for back compatibility)

On the other hand, there is another GiD-Tcl command (GiD_GetWorldCoord)that maps a 2D screen integer coordinate to 3D world coordinate, and also return the 'visual direction'
I think that you can get the visual direction you want with:
lrange [GiD_GetWorldCoord 0 0] 3 5

Re: Camera postion

Posted: Sun Aug 27, 2023 2:36 pm
by Ruberr
Hello Yves,

In GiD, you can retrieve the camera position, global up vector, and target point using the GiD_Info function. These values can be accessed through the `GiD_Info("CAMERA", ...)` function call in GiD's Tcl scripting interface. Unfortunately, specific details about extracting this information from the `.vv` file are beyond my knowledge cutoff in September 2021.

For precise instructions and the latest information, I recommend checking the official GiD documentation or seeking assistance from the GiD community or support.

Best regards,