Reading the XYZ of View Focus (ie, the Camera Target)

Started by Lar, October 25, 2014, 02:10:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lar

Hi all,

Does anyone know how to read the XYZ values of the view target location (ie, the first point the user sets when using the 'Set Viewer Points' command). I know how to set it in a macro but I don't know how to read it . I know the second point of 'Set Viewer Points', the view distance, can be read with sys(208)

I want to create a macro that has the active window's configuration written in it. So far I've been calling up a configuration saved via the 'Screen Config> Save...' command (File menu) but going that route depends on the numbers of the each window remaining consistent every time I run the macro (using more than one window). So far the window numbers have been randomly changing whenever I run the macro. I know I can save a screen config with just one window but that would generate too many individual screen config files.

Lar

prl

Lar,

As of version 24,

x,y,z (camera target location) - sys(214), sys(215), sys(216)

Lar

Thanks a million, Prl.

So this is what it feels like when they say "wow, quick response!!"

Lar

Lar

Well, I just figured out that while recording a macro with more than one window open, if you simply click on the different windows the macro will the record view config parameters for each window under the >ChangeView command <<later... just discovered it only works if the view toolbox is open>> ... <<a short time later still... still inconsistent. Best to edit one of the values in the View toolbox to the same value. That should reliably generate a >ViewChange recording with all the parameters (note that the proper parameters should be activated in the options button of the 'macro record' dialog).

This is good because I was just dreading the collecting and entering of all the info needed for this command in a macro with numerous view config changes.

Lar

prl

Quote from: Lar on October 25, 2014, 03:20:26 PM
So this is what it feels like when they say "wow, quick response!!"

I'm guessing you have something interesting in mind.  Inquiring minds want to look over your shoulder.

Lar

I need to be able to capture images of different views of a 3d model and if the model changes, which it most likely will, I can reliably recapture those images at the exact same sizes and view angles... and layer configurations. The original images will be inserted into a dcad file by reference. If changes are made I will just run a macro that will recapture those images. Just closing and reopening the dcad file containing the images will automatically update the images.

Sometimes I do this using a dcad model exported to c4d, to capture photo-realistic or artistic type images. In c4d I can animate the model so frames are captured with whatever changes needed for each image.

This whole concept should not be necessary in dcad because dcad has paper space. However, lately my paper space of 3D models has been  generating poor pdf imagery so I'm trying with bitmaps that I can control the final quality of.

Previously text entities would only be readable in very high dpi images, which not only would be large files but the lines in the images would be thin. Now the text in the pdf's are unreadable. To get very clean plots it's best to print direct from paper space but my 3D architectural projects in paper space takes very long to spool and sometimes bits get left out of the direct print.

Lar

prl

Lar, forgot to mention this.  The camera target location sys() additions came about thanks to Dt reading the DesignCAD Theory of Parallel Visibility topic.  Makes you wonder how he does it (sifting through all the nonsense).

Lar

Wow... one of those rear moments in reality when every word of a promise comes true:
Quote from: DrollTroll on April 14, 2014, 03:54:59 PM
Quoteedit: Just for information, programmatically I don't have a way of finding out in a view where the view center is.  So unless I set it, I can't tell where it is located.

Thanks for pointing this out. I think I can fix that for V24 without too much trouble -- looking at Sys(214-216) for x, y and z "camera target" point values.
Well, not only is this useful for my 'paper-space-in-model-space' method but it can really be utilized to generate animation images (a series of numbered images to import into a video editor which will compile them into an animation, the advantage of this being if there is an interruption you don't lose the entire animation up to that point, just the frame that was being rendered - a real blessing if the interruption happened 10 hours into the rendering). Imagine drawing 2 curves, one for the camera movement and one for the camera target, vector converting the curves then using the points for the camera movement and target. It'll be 'animation-in-model-space'. Using geometry you'll be able to get highly precise control of the camera.

Lar

Dr PR

Lar,

What you are describing is really the way views should work in DesignCAD, more or less.

Camera position and target together are really the direction the camera is pointing (vector from position to target). The "view distance" is the zoom level.

What we really need in DesignCAD is three settings for the view:

1. Camera position - the XYZ coordinates telling where in the drawing the camera is located. This should be set in two ways:
    a. XYZ coordinates (for macros).
    b. By just moving the cursor to rotate the camera view (for user friendly operation).
    c. By gravity snapping to an object.

2. Camera angle - which way the camera is pointed. This should be set in two ways:
    a. XY, XZ, YZ plane rotation - the angle in each plane that the camera is rotated (for macros).
    b. By just moving the cursor to rotate the camera view (for user friendly operation).
    c. By gravity snapping to an object (sets the line of sight from the camera position to to where the camera is pointed).

NOTE: 1a and 2a should be combined to use mouse movements to rotate the camera view angle and cursor key movements to walk the camera position through the drawing.

It would be nice if gravity snap to set camera position and camera angle worked while the mouse and keys were being used to move and aim the camera. That would require a SHIFT-right click or something like that to distinguish between where the camera should go and what it should point at.

3. Zoom level. This is a change in the view angle - wide angle to telephoto. The mouse wheel would be ideal for this.

Phil
DesignCAD user since 1987

prl

Quote from: Dr PR on November 01, 2014, 11:45:32 AM
3. Zoom level. This is a change in the view angle - wide angle to telephoto. The mouse wheel would be ideal for this.

For number 3, I would disagree just a bit.  I would differentiate between zoom level (mouse wheel) and field of view (focal length).  Think of zoom as the camera in your hand and you move closer or farther away from what ever you have it pointed at (focal length stays constant).  That is what zoom does now.  Think of field of view as the camera position is fixed where you originally set it (say on a tripod) and you are adjusting the focal length of the lens.  35mm being standard, 15mm being wide angle and further away and 70mm as being cropped and closer.  With the emphasis being that you will never go behind the camera, duh.  So we would need a separate control for that, some combo keys and the mouse wheel.

Dr PR

prl,

I am a photographer and I have several zoom lenses. With camera zoom lenses the effect you see through the lens is to change the viewing angle from wide to narrow (or vice versa) to frame the view you want. Technically it is a change in focal length in the optics but no one gives a damn about the focal length. It is the view angle that matters, and that's why we have zoom lenses so we can change that view angle without switching lenses.

No matter where you are standing with a camera, where you move or where you point the camera, the zoom function expands the field of view or reduces it. I think it would be much more user friendly if the viewing operations were described as if we were using an ordinary camera. This is especially true with walk throughs and animations.

I know how DesignCAD works now and it is totally screwball. With a camera the view angle (zoom, field of view) doesn't change because you move the camera, but it does with DesignCAD. The camera isn't locked in to pointing at a single spot as you walk around, but it is in DesignCAD. It is totally non-intuitive.

Phil
DesignCAD user since 1987

prl

Quote from: Dr PR on November 01, 2014, 09:40:35 PM
With a camera the view angle (zoom, field of view) doesn't change because you move the camera, but it does with DesignCAD.

MOVED MY RESPONSE here http://forum.designcad.com/index.php?topic=5968.msg42017#msg42017