Archicad C++ API
About Archicad add-on development using the C++ API.

Camera position in axonomtery

Tomasz Marek
Beginner
I have hard time getting a position of a camera with axonometric projection.
The 3x3 Transformation gives just info on direction and axonomtery in general.
Camera->GetViewPoint() works only for perspective. How can I figure out a center of a view?
10 REPLIES 10
Achille Pavlidis
Enthusiast
well, there actually isn't a camera position in axonometry. Axonometry is a parallel projection just like a plan or an elevation.
Mac OSX 13.6.6 | AC 27 INT 5003 FULL
Tomasz Marek
Beginner
How will you match a render with a view in 3D window?
You can pan&zoom 3d view and a Archicad rendering covers just exactly this portion of the view ( camera->GetBounds() ). Direction is not enough, I have to have a point in 3D space to "attach" this vector to.

There is no "camera" position , but a "viewer position" given that the view area doesn't match an exact extents of a model.
Achille Pavlidis
Enthusiast
maybe post some screenshots, to understand what you are after
Mac OSX 13.6.6 | AC 27 INT 5003 FULL
Tomasz Marek
Beginner
I think it clarifies it well enough.
Two 400x300 renderings of an axonometry of same model.
Without knowing the position I cannot replicate the view/rendering.
AxonomteryViewCenter.jpg
Ralph Wessel
Mentor
Tomasz wrote:
I have hard time getting a position of a camera with axonometric projection.
The 3x3 Transformation gives just info on direction and axonomtery in general.
Camera->GetViewPoint() works only for perspective. How can I figure out a center of a view?
Sorry, that's all the information you can get from the API (as far as I'm aware). It is quite limiting, but reflects the way ArchiCAD works.
Ralph Wessel BArch
Software Engineer Speckle Systems
Tomasz Marek
Beginner
The ExampleRenderingAddOn supplied with SDK 16 renders the view correctly, so there must be a way of figuring out a center of the view. I am surprised GS didn't supply such a basic functionality in their SDK.

I have spent few hours analyzing the example, but haven't found a solution yet.
ivanfi
Graphisoft Alumni
Graphisoft Alumni
Calling GetBounds () on the axonometric camera tells you the bounding box of the region that should be displayed. The center of the view is the center of this bounding box.
Hope this helps,
Zoltan
Zoltan Ivanfi
Software Engineer
Graphisoft
Tomasz Marek
Beginner
ivanfi wrote:
Calling GetBounds () on the axonometric camera tells you the bounding box of the region that should be displayed. The center of the view is the center of this bounding box.
Bounding box gives me just horizontal and vertical size of a visible space. It doesn't give me the center, which should be 3D point. Get Bounds() returns two 2d points!
ivanfi
Graphisoft Alumni
Graphisoft Alumni
The bounding box is 2D because it is the bounding box for clipping after the projection. There is no camera position in axonometric projection, only a direction and a 2D bounding box for clipping. It is enough to clip the result after the projection, because the unclipped result is independent of the bounding box.
Zoltan Ivanfi
Software Engineer
Graphisoft