LDraw.org Discussion Forums
Tourguide or walktrough animation - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html)
+--- Thread: Tourguide or walktrough animation (/thread-23778.html)

Pages: 1 2 3 4 5


RE: Tourguide or walktrough animation - Moreau - 2019-12-23

(2019-12-06, 1:59)Roland Melkert Wrote: I liked the idea of an animated model tour from a minifig's perspective a lot (see  https://forums.ldraw.org/thread-23512-post-34790.html#pid34790)

So I made a start on a generic script for it, to be included with LDCad 1.6c

Many things can be improved, but I'm very proud on the fact this was 'doable' without finding any bugs out of the box.

Attached a demo.

Any feedback / ideas on improvements are welcome.

A appropriate (big) model for testing purposes would be appreciated too.

edit:
This animation takes over the camera during playback. You can disable/enable that by clicking the 'CAM' label in the top right session panel in animation mode.
interesting, however i have some questions.
how do i toggle the camera to first person instead of third? i tried editing the one line in samples > camera test, from camConfusedetThirdPerson(camPos, camDist, angle+45, 25, 0)
to camConfusedetFirstPerson(camPos, camDist, angle+45, 25, 0)
and all it did was look up instead of down, though maybe it did stay in one place while doing so?

trying to move the camera with the mouse during playback just makes it look shakey
i admit i am still new to all this Lua stuff (as a first programming language), but i thought the only difference should be the first person camera remains stationary and just rotates the model space around it.
maybe what i want does'nt exist yet. is there even a way to toggle the mouse camera to first instead of third person perspective?


RE: Tourguide or walktrough animation - Moreau - 2019-12-23

(2019-12-06, 18:37)Roland Melkert Wrote: Thanks for mailing the model, very nice one.

Too bad it only does 15fps on my system.

You could add door animations to also go inside etc to make it even more interesting. Would probably take ages to render in povray tough Smile
why is the frame rate not set in stone?


RE: Tourguide or walktrough animation - Moreau - 2019-12-23

(2019-12-23, 12:22)Moreau Wrote: interesting, however i have some questions.
how do i toggle the camera to first person instead of third? i tried editing the one line in samples > camera test, from camConfusedetThirdPerson(camPos, camDist, angle+45, 25, 0)
to camConfusedetFirstPerson(camPos, camDist, angle+45, 25, 0)
and all it did was look up instead of down

trying to move the camera with the mouse during playback just makes it look shakey
i admit i am still new to all this Lua stuff (as a first programming language), but i thought the only difference should be the first person camera remains stationary and just rotates the model space around it.
maybe what i want does'nt exist yet. is there even a way to toggle the mouse camera to first instead of third person perspective?
upon further investigating scripts > misc > current camera, and selecting () "script first person camera" from the format list, the repeating after moving the camera with the mouse, yields two sets of values.

ldc.camera(1, ldc.vector(3939.7942, -1547.4372, -2197.128), 4549.2681, -60, -15, 0)
ldc.camera(1, ldc.vector(1897.3212, -1839.676, -1139.8568), 2558.9633, -60, -37.05, 0)

so clearly the program can identify the position in partspace and angle of the camera eye. i also assume the first three are XYZ position. But what are the other values?


RE: Tourguide or walktrough animation - Roland Melkert - 2019-12-23

(2019-12-23, 12:44)Moreau Wrote: upon further investigating scripts > misc > current camera, and selecting () "script first person camera" from the format list, the repeating after moving the camera with the mouse, yields two sets of values.

ldc.camera(1, ldc.vector(3939.7942, -1547.4372, -2197.128), 4549.2681, -60, -15, 0)
ldc.camera(1, ldc.vector(1897.3212, -1839.676, -1139.8568), 2558.9633, -60, -37.05, 0)

so clearly the program can identify the position in partspace and angle of the camera eye. i also assume the first three are XYZ position. But what are the other values?

The tour animation has a cameraMode variable at the top, change it to 1 for first person mode.

ldc.camera parameters are 'mode' followed by a number of mode depend ones.

first person
ldc.camera(1, eye, dist, yaw, tilt, roll)

third person
ldc.camera(3, lookAt, dist, yaw, tilt, roll)

two point
ldc.camera(2,lookAt, eye, roll

advanced
ldc.camera(0,lookAt, ori, dist)

mode 1..3 are basically just wrappers as internally all cameras are 'advanced'.


RE: Tourguide or walktrough animation - Moreau - 2019-12-26

(2019-12-23, 21:18)Roland Melkert Wrote: The tour animation has a cameraMode variable at the top, change it to 1 for first person mode.

ldc.camera parameters are 'mode' followed by a number of mode depend ones.

first person
ldc.camera(1, eye, dist, yaw, tilt, roll)

third person
ldc.camera(3, lookAt, dist, yaw, tilt, roll)

two point
ldc.camera(2,lookAt, eye, roll

advanced
ldc.camera(0,lookAt, ori, dist)

mode 1..3 are basically just wrappers as internally all cameras are 'advanced'.
why would first person need a distance? I'm guessing the 'eye' is the position in xyz, which is what i would want to move via script. the last three parameters i would want to be mouse controlled. is that possible?


RE: Tourguide or walktrough animation - Michael Horvath - 2020-02-02

I have wanted to do the same with Datsville, but I get less than 1 FPS in LDView, and POV-Ray takes about an hour to render the whole town on my old CPU. (More if I use LGEO parts, turn on radiosity, etc.)


RE: Tourguide or walktrough animation - Michael Horvath - 2020-02-02

(2019-12-26, 1:03)Moreau Wrote: why would first person need a distance? I'm guessing the 'eye' is the position in xyz, which is what i would want to move via script. the last three parameters i would want to be mouse controlled. is that possible?

I suppose if you wanted to add focal blur in POV-Ray you would need to know the distance as well.


RE: Tourguide or walktrough animation - Moreau - 2020-02-16

(2020-02-02, 19:24)Michael Horvath Wrote: I suppose if you wanted to add focal blur in POV-Ray you would need to know the distance as well.
 I'm not using POVray, just Ldraw. i have yet to find anything like a setting to switch from 3rd to 1st person perspective in editing mode.


RE: Tourguide or walktrough animation - Roland Melkert - 2020-02-16

(2020-02-16, 19:39)Moreau Wrote:  I'm not using POVray, just Ldraw. i have yet to find anything like a setting to switch from 3rd to 1st person perspective in editing mode.

The distance parameter is indeed a preparation on blur support in (pov) exports.

The editor doesn't have a 1st person mode, only trackball or spin control.

The camera tools in the scripts menu are helpers to initialize ldc.camera objects in animation scripts.

The walk trough animation script lets you switch from 1st to 3rd person by editing the cameraMode variable at the top.


RE: Tourguide or walktrough animation - Roland Melkert - 2020-02-16

(2020-02-02, 19:22)Michael Horvath Wrote: I have wanted to do the same with Datsville, but I get less than 1 FPS in LDView, and POV-Ray takes about an hour to render the whole town on my old CPU. (More if I use LGEO parts, turn on radiosity, etc.)

You can also export the OpenGL renderings as a sequence of png's. This can be done in higher resolutions then your screen and at higher frame rates then realtime could manage.