[LDCad] ldc.camera.setThirdPerson API - 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: [LDCad] ldc.camera.setThirdPerson API (/thread-25041.html) |
ldc.camera.setThirdPerson API - David Manley - 2021-08-31 (Probably for Roland but if someone else has worked this out, please chip in). Context: I'm trying to write a (Lua) animation script which will rotate the 3rd person view camera around the Y axis starting at the current view, rather than the start point used in the sample script. From the sample scripts, I can see the purpose of the first two arguments (helped by the description in LD4Studio documentation) but I'm struggling to understand the purpose next 3 angle (?) related arguments. The sample script in the function OnCameraFrame ... Code: function onCameraFrame() ... is applying an appropriate angle change to the third parameter. From playing around a bit, it seems that parameters three, four and five are related to a x, y, z coordinate. But even though the code applies the angle delta to the X value (I think), the camera appears to rotate around the Y axis. And that confuses me as I would have though that to rotate the camera around the Y axis would have required the angle delta to be applied to the y coordinate. I'd appreciate it if someone could clear up my misunderstanding. Regards, David RE: ldc.camera.setThirdPerson API - Roland Melkert - 2021-08-31 [quote pid="42618" dateline="1630401603"] I'd appreciate it if someone could clear up my misunderstanding. [/quote] The parameters are: yaw, moves the camera around the look at point like the hands on a clock. tilt, indirectly controls the 'height' of the camera stand. roll, rotates the camera around its looking direction. e.g. 180 degrees is like holding your camera up side down while taking a picture. LD4DStuido didn't have the roll option, but it felt more complete to always offer yaw,tilt and roll parameters for all the camera variants. In practice you'll usually have a static tilt and a roll of zero. RE: ldc.camera.setThirdPerson API - David Manley - 2021-09-01 (2021-08-31, 17:54)Roland Melkert Wrote: [quote pid="42618" dateline="1630401603"] [/quote] Thank you Roland, that helped a lot. I can now demonstrate a comparison between the standard camera view rotation (from the samples scripts) and a customised rotation, which allows a user to select the degrees to rotate, the duration of the rotation while using the current view as the animation start point. If anyone wants this rotation script, it is listed here: Code: function animation_parameter_prompt_gf() Regards, David |