Camera postion

Moderator: GiD Team

Post Reply
User avatar
Felguf
Posts: 10
Joined: Mon Sep 25, 2017 11:14 am
Location: Liège, Belgium
Contact:

Camera postion

Post 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
User avatar
escolano
Posts: 1946
Joined: Sun Sep 05, 1982 10:51 pm

Re: Camera postion

Post 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
Ruberr
Posts: 1
Joined: Fri Aug 25, 2023 11:48 am

Re: Camera postion

Post 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,
Post Reply