Tourguide or walktrough animation


Tourguide or walktrough animation
#1
I liked the idea of an animated model tour from a minifig's perspective a lot (see  https://forums.ldraw.org/thread-23512-po...l#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.


Attached Files
.zip   tour.zip (Size: 3.21 KB / Downloads: 50)
Reply
RE: Tourguide or walktrough animation
#2
(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-po...l#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.

Nice! I can send you a big (16.000 bricks) model of a building.
Jaco van der Molen
lpub.binarybricks.nl
Reply
RE: Tourguide or walktrough animation
#3
Now that's fun!


Attached Files
.zip   coaster.zip (Size: 57.38 KB / Downloads: 25)
Reply
RE: Tourguide or walktrough animation
#4
(2019-12-06, 7:52)Jaco van der Molen Wrote: Nice! I can send you a big (16.000 bricks) model of a building.

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
Reply
RE: Tourguide or walktrough animation
#5
(2019-12-06, 10:07)Philippe Hurbain Wrote: Now that's fun!

Love the roller-coaster use.

But the current version is setup for a constant Z so weird scaling occurs, as I was thinking to use different animation code for things like stairs etc.

I'll try to improve the Z handling.
Reply
RE: Tourguide or walktrough animation
#6
(2019-12-06, 10:07)Philippe Hurbain Wrote: Now that's fun!

Neither one works for me, tells me it takes too long (250ms seems some limit) any clue?
Reply
RE: Tourguide or walktrough animation
#7
(2019-12-06, 21:30)Gerald Lasser Wrote: Neither one works for me, tells me it takes too long (250ms seems some limit) any clue?

Are you on a very old system?

250ms translates into less then 4 frames per second, which is extremely slow for the relative simple tour.mpd model.
Reply
RE: Tourguide or walktrough animation
#8
(2019-12-06, 22:23)Roland Melkert Wrote: Are you on a very old system?

250ms translates into less then 4 frames per second, which is extremely slow for the relative simple tour.mpd model.
I'll restart my PC, haven't done so in a while. I hope it makes it going again


-> That helped, now it is running smooth....!
Reply
RE: Tourguide or walktrough animation
#9
Brick 
(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-po...l#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.
much appreciated! I'm sure this will give me a jumping-off point for doing other scripting, and i'll let you know what i come up with.
have you started a section to the forum for custom scripts or does that go along with the custom model show-n-tell (MOC's)
Reply
RE: Tourguide or walktrough animation
#10
(2019-12-07, 17:59)Moreau Wrote: have you started a section to the forum for custom scripts or does that go along with the custom model show-n-tell (MOC's)

Id say that prolly fits best in Rendering Techniques.
Reply
RE: Tourguide or walktrough animation
#11
(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-po...l#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?
Reply
RE: Tourguide or walktrough animation
#12
Brick 
(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?
Reply
RE: Tourguide or walktrough animation
#13
Brick 
(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?
Reply
RE: Tourguide or walktrough animation
#14
(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'.
Reply
RE: Tourguide or walktrough animation
#15
(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?
Reply
RE: Tourguide or walktrough animation
#16
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.)
Reply
RE: Tourguide or walktrough animation
#17
(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.
Reply
RE: Tourguide or walktrough animation
#18
Brick 
(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.
Reply
RE: Tourguide or walktrough animation
#19
(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.
Reply
RE: Tourguide or walktrough animation
#20
(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.
Reply
RE: Tourguide or walktrough animation
#21
(2020-02-16, 20:00)Roland Melkert Wrote: 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.

I have probably suggested this already, but a "walk" camera mode that works like first-person shooter video games would be very nice (for my very large horizontal town models). The dev version of LDView already has this feature, but sadly the framerate is much worse than LDCad on my very old computer and video card.

Sad
Reply
RE: Tourguide or walktrough animation
#22
(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-po...l#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.

This is nice! I really liked LD4DModeler even though I didn't get an opportunity to use it.

[edit]

Oops, I responded to this once already.
Reply
RE: Tourguide or walktrough animation
#23
Brick 
minor update, progress of a sort.
(2020-02-16, 21:40)Michael Horvath Wrote: I have probably suggested this already, but a "walk" camera mode that works like first-person shooter video games would be very nice (for my very large horizontal town models). The dev version of LDView already has this feature, but sadly the framerate is much worse than LDCad on my very old computer and video card.

Sad
I have discovered that by turning off number-lock, and zooming in all the way with the mouse wheel, that i can use the number pad arrows to move the camera in those directions. its only perpendicular to the camera center, so if i want to move only horizontally in partspace i need to be looking straight up or down. The increments are very small but the motion is smooth (at greater distances than zero, the increments are greater). At zero distance i can look around as if in first person. the arrows on the editing compass still work the same for more rapid repositioning of the camera in partspace.
Reply
RE: Tourguide or walktrough animation
#24
(2020-02-16, 22:25)Michael Horvath Wrote: This is nice! I really liked LD4DModeler even though I didn't get an opportunity to use it.

LD4DModeler has been replaced by LD4DStudio ages ago, which is still available.
http://www.ld4dstudio.nl/

Funny is was just considering canceling the .nl domain the other day Smile

I have no idea if it works on win10, I think it should though, given you install it outside the program files folder or use the archive version.
Reply
RE: Tourguide or walktrough animation
#25
(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-po...l#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.
Roland, i am very much interested in your walk through script project. I have an enormous lego build that i have been working on for over a year. Probably over 150,000 bricks; it is a build of a local rural town in our area.  My vision from the start was to eventually showcase it in a youtube video so it can be enjoyed by all. i am currently still putting finishing touches on it. I envision like a low drone flyover panning in both directions but any video footage would be acceptable .  I posted an earlier reply for solutions to create a video about 8 months ago but never got any real good solutions.  Yours is the first post that appears to be what i am looking for.  However i am very inexperienced at Ldraw. i mostly build in Lego digital designer and then convert to ldraw. I know the basics and that's about it. 
1) Is it possible to teach a rookie like me how to use your script?
2) Is it worth it to learn the system for a 1 time project?
3) Is there an Ldraw techie who i could hire to do a video? i would certainly consider paying someone to do this.
4) i also would be willing to pay for some ldraw training via zoom if you or anyone is interested

i am very excited to learn more about your script 
kevin

[Image: montgomery+lego+screen+grab.jpg?o=An9SZM...mb8B4&cd=i]
[Image: montgomery+lego+screen+grab+2.jpg?o=As1x...ynDqw&cd=i]
Reply
RE: Tourguide or walktrough animation
#26
(2020-05-08, 17:07)kevlamar Wrote: 1) Is it possible to teach a rookie like me how to use your script?
2) Is it worth it to learn the system for a 1 time project?

The script is basically an 'extra' button in the gui, the only thing you need to do is spreading the 'breadcrumbs' around in your model.

But with a very large model realtime playback might be a problem so you would need to export the animation and combine images to e.g. an avi file to get fluent playback.

To get started try this:

1. Export your LDD model to a ldr file.
2. Save the above zip to the same location and unpack it.
3. Open the ldr in LDCad
4. Drag and drop the .lua file onto LDCad to link the script to the model.
5. In the search bin (minfig with magnifying glass) search for :   tile 1x1 round pin hole
6. Use that part to map a route inside your model.
7. When you got a couple of them placed start the animation with the menu: /scripts/<your model>/Minifig tour

This all assuming your model is level grounded, if not the script would need a minor adjustment compensate for this. Let me know if it's needed as I was planning to adjust the script for it anyway sometime.
Reply
RE: Tourguide or walktrough animation
#27
(2020-05-08, 20:06)Roland Melkert Wrote: The script is basically an 'extra' button in the gui, the only thing you need to do is spreading the 'breadcrumbs' around in your model.

But with a very large model realtime playback might be a problem so you would need to export the animation and combine images to e.g. an avi file to get fluent playback.

To get started try this:

1. Export your LDD model to a ldr file.
2. Save the above zip to the same location and unpack it.
3. Open the ldr in LDCad
4. Drag and drop the .lua file onto LDCad to link the script to the model.
5. In the search bin (minfig with magnifying glass) search for :   tile 1x1 round pin hole
6. Use that part to map a route inside your model.
7. When you got a couple of them placed start the animation with the menu: /scripts/<your model>/Minifig tour

This all assuming your model is level grounded, if not the script would need a minor adjustment compensate for this. Let me know if it's needed as I was planning to adjust the script for it anyway sometime.
my files are already converted to ldr so that is out of the way.  there are a few steps i will need explained further...
Step 4. and
Step 7. 

 Also i dont quite understand what you are saying here ...
[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]But with a very large model realtime playback might be a problem so you would need to export the animation and combine images to e.g. an avi file to get fluent playback.

once i get your explanation on those steps i will probably start out practicing with with a smaller model for a while to get the hang of it before moving on the the full model. (it is not quite complete anyhow.)

Thank you so much for the help. i will keep in touch and share the results with you. I am very excited as i was beginning to resign myself to the notion that i would have to rely on making a video of my creation out of a montage of still photos. This has renewed my hope that this can be shared as an animation  Smile

kevin

 [/font][/size][/color]
Reply
RE: Tourguide or walktrough animation
#28
(2020-05-08, 20:06)Roland Melkert Wrote: This all assuming your model is level grounded, if not the script would need a minor adjustment compensate for this. Let me know if it's needed as I was planning to adjust the script for it anyway sometime.

also, i am not quit sure what "level grounded" means but i am pretty certain mine is not.  It encompases various sub models and thay are situated at various heights due to the terrain going uphill so from the bottom it looks pretty ugly.  Confused

kevin
Reply
RE: Tourguide or walktrough animation
#29
(2020-05-08, 23:32)kevlamar Wrote: i will need explained further...
Step 4. and Step 7.

4: Open the windows file explorer and using the mouse drag the .lua file onto the LDCad program window while your model is open in it.
7: In the top menu bar their is a 'scripting' item inside it is an item with the name of the current open file, inside that item their is an item "Minifig tour". Use that to start the animation.


(2020-05-08, 23:32)kevlamar Wrote: Also i dont quite understand what you are saying here

A 150 thousand part model might not be able to animate in realtime (at 25fps), you would need to lower the frame rate or export it to a collection of png files which you can combine into a movie using a video editor.
Reply
RE: Tourguide or walktrough animation
#30
(2020-05-08, 23:32)kevlamar Wrote: my files are already converted to ldr so that is out of the way.  there are a few steps i will need explained further...
Step 4. and
Step 7. 

 Also i dont quite understand what you are saying here ...
[color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif]But with a very large model realtime playback might be a problem so you would need to export the animation and combine images to e.g. an avi file to get fluent playback.

once i get your explanation on those steps i will probably start out practicing with with a smaller model for a while to get the hang of it before moving on the the full model. (it is not quite complete anyhow.)
Thank you so much for the help. i will keep in touch and share the results with you. I am very excited as i was beginning to resign myself to the notion that i would have to rely on making a video of my creation out of a montage of still photos. This has renewed my hope that this can be shared as an animation  Smile

kevin

 [/font][/size][/color]
this is probably the most rookie question ever, but i have been trying to figure this out for a long time and just have to ask...
"how do you do an inventory search?"  I see the little man with magnifying glass, but clicking on him just open a subcategory that has no parts in it!    i can also use the filter feature to narrow down to a certain part but i have to have the right subcategory open first.

Is the 1x1 round pin hole piece you are referring to the one with the star?

Thanks for tutoring a rookie Smile
Kevin
Reply
RE: Tourguide or walktrough animation
#31
(2020-05-10, 15:26)kevlamar Wrote: this is probably the most rookie question ever, but i have been trying to figure this out for a long time and just have to ask...
"how do you do an inventory search?"  I see the little man with magnifying glass, but clicking on him just open a subcategory that has no parts in it!    i can also use the filter feature to narrow down to a certain part but i have to have the right subcategory open first.
That's precisely the purpose of minifig with magnifying glass bin: search regardless of category. But you have to enter some filter text to see parts appear...
Otherwise, you can have a look at my roller coaster test (post 3 of this thread) for a usage example that works in 3D and not only at ground level.
Reply
RE: Tourguide or walktrough animation
#32
(2020-05-09, 22:20)Roland Melkert Wrote: 4: Open the windows file explorer and using the mouse drag the .lua file onto the LDCad program window while your model is open in it.
7: In the top menu bar their is a 'scripting' item inside it is an item with the name of the current open file, inside that item their is an item "Minifig tour". Use that to start the animation.



A 150 thousand part model might not be able to animate in realtime (at 25fps), you would need to lower the frame rate or export it to a collection of png files which you can combine into a movie using a video editor.
i am really close but here is what the scripting console window shows when i try to run the minifig script
[string "tour.lua"]:140: Active refline link needed.

i am able to run the tour file fine and initiate the minifugure tour. 

i open the ldr file the drag the .lua file into the window. the first time i did it, i was given two choices that i didnt understand and i selected one. now i am no longer given those options even though i have deleted and recreated all the files fresh

what an i doing wrong?
Reply
RE: Tourguide or walktrough animation
#33
(2020-05-10, 17:46)kevlamar Wrote: what an i doing wrong?
Nothing, I forgot to mention there needs to be a submodel with the name:

fig.ldr

the script uses it to position the camera.
Reply
RE: Tourguide or walktrough animation
#34
(2020-05-10, 17:53)Roland Melkert Wrote: Nothing, I forgot to mention there needs to be a submodel with the name:

fig.ldr

the script uses it to position the camera.
Oh yeah, now we are going places!   is it possible to position the camera to look straight ahead?

this is exactly what i had in mind.

Would you consider doing some tutoring via zoom helping me get a handle on the process of rendering animations and pov-ray in general.  would be glad to pay up front with Paypal $30 hr  or do you know anyone who from the community that would.  My objective is to create pov-ray video animations.  

Kevin
Reply
RE: Tourguide or walktrough animation
#35
(2020-05-10, 19:30)kevlamar Wrote: Would you consider doing some tutoring via zoom helping me get a handle on the process of rendering animations and pov-ray in general.
I'm very busy this week, but I'll try to answer any question asked here as I often visit the site in my breaks.
Reply
RE: Tourguide or walktrough animation
#36
(2020-05-10, 15:42)Philippe Hurbain Wrote: you can have a look at my roller coaster test (post 3 of this thread) for a usage example that works in 3D and not only at ground level.
Did you compensate the ori matrix for the deforming my initial version has ?

Should only need a simple crossproduct if you don't actually do loops.
Reply
RE: Tourguide or walktrough animation
#37
(2020-05-10, 20:50)Roland Melkert Wrote: I'm very busy this week, but I'll try to answer any question asked here as I often visit the site in my breaks.
thanks. i was able to open the source code to the .lua file in a text editor and found the setting i was looking for.  i will continue to play with it as i put the for the time being. I am still a little way from having my model completed.  once it is finished i will likely need some help videoing it

thanks
kevin
Reply
RE: Tourguide or walktrough animation
#38
(2020-05-10, 21:30)kevlamar Wrote: thanks. i was able to open the source code to the .lua file in a text editor and found the setting i was looking for.  i will continue to play with it as i put the for the time being. I am still a little way from having my model completed.  once it is finished i will likely need some help videoing it

thanks
kevin
roland i got the script working fine in small models and have learned how to make some basic alterations to the script but when i tryed to run it in my large model i get this error msg:  

Playback is too slow for 25 fps at an avg frame time of 145.31ms.

how do i drop the frames per second down to a lower level.  i have scrolled through the lua script several times but do not see any obvious tags that say 25 fps.  am i overlooking it? if so can you tell me about what line it is on. or maybe does fps need to be set in ldraw?  can you help me out?
Reply
RE: Tourguide or walktrough animation
#39
(2020-05-23, 20:17)kevlamar Wrote: how do i drop the frames per second down to a lower level.  i have scrolled through the lua script several times but do not see any obvious tags that say 25 fps.  am i overlooking it? if so can you tell me about what line it is on. or maybe does fps need to be set in ldraw?  can you help me out?

FPS can be set using the session panel. For this move your mouse over the file name area in the top right corner of the editing space.

On the animation tab there is an indication of the current fps, click it to change it.
Reply
RE: Tourguide or walktrough animation
#40
(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-po...l#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.
i tried deleting a few lines i thought might be restricting the camera angle of view but must have deleted too many lines so i ended up trashing tho whole script since there was nothing i could do to restore it. I'm still not sure though how to release the camera angle in a way that won't return to preset with every frame. i also have not found out how the script knows which "breadcrumb" to GOTO next in the line on the model. any hints?
Reply
RE: Tourguide or walktrough animation
#41
(2020-05-25, 6:37)Moreau Wrote: i tried deleting a few lines i thought might be restricting the camera angle of view but must have deleted too many lines so i ended up trashing tho whole script since there was nothing i could do to restore it. I'm still not sure though how to release the camera angle in a way that won't return to preset with every frame. i also have not found out how the script knows which "breadcrumb" to GOTO next in the line on the model. any hints?
The order of breadcrumbs in the LDraw file is the order used for the movement. It helps to display the source window.
Reply
RE: Tourguide or walktrough animation
#42
(2020-05-25, 8:16)Philippe Hurbain Wrote: The order of breadcrumbs in the LDraw file is the order used for the movement. It helps to display the source window.
yeah i figured that out by rearranging them but none of the lines are numbered so without hovering/selecting its not possible to tell which piece corresponds to which line on the list, nor is there any way i can see to rearrange the pieces up or down in the source window.

Oh! i can open the .ldr file with text editor instead of Ldraw and all the lines there are numbered. well that's one way to find out how many total parts are in my models, almost.

another couple problems i discovered with the animation is that if i pause the playback and rotate the view, the camera position has changed (i had it set to 1st person on line 23), and even though i had the camera rotation set to SPN it was rotating as if in TBL, and did not revert to SPN untill i toggled it to TBL and back again to SPN. very disorienting! (i never use TBL).

Still trying to figure out how to allow camera rotation during animation play. i suspect its somewhere between lines 229 and 249.
Reply
RE: Tourguide or walktrough animation
#43
(2020-05-08, 23:38)kevlamar Wrote: also, i am not quit sure what "level grounded" means but i am pretty certain mine is not.  It encompases various sub models and thay are situated at various heights due to the terrain going uphill so from the bottom it looks pretty ugly.  Confused

kevin
the y position value of the base you are using is zero and grid orientation is set to absolute?

i just tried placing one of the breadcrumbs on a 1x1x5 brick and the minifig still followed the trail, going up to the high point and back down to the next, so if you're using a contoured base or whatever, as long as your breadcrumbs are where you want the minifig's feet to go it should work without unnecessary clipping.
Reply
RE: Tourguide or walktrough animation
#44
(2020-05-25, 16:03)Moreau Wrote: yeah i figured that out by rearranging them but none of the lines are numbered so without hovering/selecting its not possible to tell which piece corresponds to which line on the list, nor is there any way i can see to rearrange the pieces up or down in the source window.

Oh! i can open the .ldr file with text editor instead of Ldraw and all the lines there are numbered. well that's one way to find out how many total parts are in my models, almost.
You can move lines around by just dragging them.

Or if you want to change the order select them in the order you want them using the 3d view, and the n grab any of the selected lines in the source window and move the 'insertion line' to the top of the selection. This will force the lines in the same order as the selection.

(2020-05-25, 16:03)Moreau Wrote: another couple problems i discovered with the animation is that if i pause the playback and rotate the view, the camera position has changed (i had it set to 1st person on line 23), and even though i had the camera rotation set to SPN it was rotating as if in TBL, and did not revert to SPN untill i toggled it to TBL and back again to SPN. very disorienting! (i never use TBL).
The camera control is always trackball during animation playback unless the "CAM" label is red in the top right session panel. This because the animation needs full control of the camera and not be limited by the horizontal orientation of spin control.


(2020-05-25, 16:03)Moreau Wrote: Still trying to figure out how to allow camera rotation during animation play. i suspect its somewhere between lines 229 and 249.
I'm not sure what you mean here, if you want manual control of the camera during playback disable the CAM option mentioned above.

Or do you want manual control like in a first person action came, from the mifig's perspective during playback. This is not possible in 1.6, it's a planned 1.7 feature though.
Reply
RE: Tourguide or walktrough animation
#45
(2020-05-25, 18:23)Roland Melkert Wrote: You can move lines around by just dragging them.

Or if you want to change the order select them in the order you want them using the 3d view, and the n grab any of the selected lines in the source window and move the 'insertion line' to the top of the selection. This will force the lines in the same order as the selection.

The camera control is always trackball during animation playback unless the "CAM" label is red in the top right session panel. This because the animation needs full control of the camera and not be limited by the horizontal orientation of spin control.


I'm not sure what you mean here, if you want manual control of the camera during playback disable the CAM option mentioned above.

Or do you want manual control like in a first person action came, from the mifig's perspective during playback. This is not possible in 1.6, it's a planned 1.7 feature though.
then may i suggest hotkeys for moving the 1st person camera in +/-x, y, z directions? i suggest N, S, E, W, U, D, with the movement incriments being the same as the red green and blue in the edit compass box.

Which string forces the camera to "keep looking forward" relative to the minifig?
Reply
RE: Tourguide or walktrough animation
#46
(2020-05-25, 20:13)Moreau Wrote: then may i suggest hotkeys for moving the 1st person camera in +/-x, y, z directions? i suggest N, S, E, W, U, D, with the movement incriments being the same as the red green and blue in the edit compass box.
1.7 will feature interactive animation so how it responds to the keyboard etc is all up to the animation script.

(2020-05-25, 20:13)Moreau Wrote: Which string forces the camera to "keep looking forward" relative to the minifig?

The line

seq:addAction(aniTools.funcDepAction(camAct.yaw, 0, nil, actor.dir, dep))

sets up a dependency action based on the direction between two breadcrumbs (the one the minifig is in between at the moment).

It uses that direction and the rest Z-Direction to calculate the camera left/right angle.
Reply
RE: Tourguide or walktrough animation
#47
(2020-05-25, 22:23)Roland Melkert Wrote: seq:addAction(aniTools.funcDepAction(camAct.yaw, 0, nil, actor.dir, dep))

sets up a dependency action based on the direction between two breadcrumbs (the one the minifig is in between at the moment).

It uses that direction and the rest Z-Direction to calculate the camera left/right angle.
i can change the fps to 1 which allows me to look around and for some inexplicable reason the first person camera is still nowhere near the minifig center where it ideally should be. even if i don't try to look around with the mouse it seems the first person camera is placed somewher way out in front of the minifig.

"seq:addAction(aniTools.funcDepAction(camAct.yaw, 0, nil, actor.dir, dep))"
i tried deleting that line and the camera fell off the truck and was left at 0, 0, 0
what do you mean by "rest z-direction"?

it still turns to look in the direction of the minifig's changing position, and still reverts back to that focus at the start of each new frame when i try looking around.
Reply
RE: Tourguide or walktrough animation
#48
(2020-05-25, 8:16)Philippe Hurbain Wrote: The order of breadcrumbs in the LDraw file is the order used for the movement. It helps to display the source window.
Admittedly the method use is not how i would have approached the problem. there are noticeable flaws in the path of the minifig i can't account for (not only because i can barely read the script), but then i'm not used to just letting a computer tell itself what to do.

I had hoped to be able to instruct the camera to move similarly to how i would have instructed a turtle to plot a course way back in the days of LEGO2LOGO.
for example, something like:
set start camera position at 0,-88, 0
move camera east at 1 per frame for 80 frames
turn -1degree per frame for 90 frames
move camera north at 1 per frame for 80 frames

etcetera.
Reply
RE: Tourguide or walktrough animation
#49
(2020-05-25, 23:31)Moreau Wrote: i can change the fps to 1 which allows me to look around and for some inexplicable reason the first person camera is still nowhere near the minifig center where it ideally should be. even if i don't try to look around with the mouse it seems the first person camera is placed somewher way out in front of the minifig.
The script places the camera roughly at the 'nose' position of the minfig, this asuming you're using a minifig submodel like in the example. If not you need to adjust the coordinates, given at the top of the script.

(2020-05-25, 23:31)Moreau Wrote: what do you mean by "rest z-direction"?
A camera without angles always looks along the z-axis (blue one in the compass).

(2020-05-25, 23:31)Moreau Wrote: it still turns to look in the direction of the minifig's changing position, and still reverts back to that focus at the start of each new frame when i try looking around.
Once the animation is paused normal (trackball) camera control is enabled, what you want to do would need interactive animation so the script can calculate things not just based on the frame time but also on mouse interaction etc. Like I said this is a planned 1.7 feature.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)