Jump to content

ArmTwilight

Resident
  • Posts

    4
  • Joined

  • Last visited

Reputation

2 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Turns out I was nearly there with what I had already (but not quite so your pointers definitely pointed me in the right direction)... I'm ashamed to say that my previous results weren't anywhere near because I'd completely forgotten to update the HUD with the new pos/rot of the photo booth after I'd moved or rotated it!!! It was still using the previous pos and rot of the booth... Doh! Now I've corrected that amateur error and corrected my code after reading both your suggestions it's working perfectly, so thanks again for pointing me in the right direction.
  2. Thank you both so much for your suggestions. I will try later when I go in world and let you know how I got on!
  3. Thanks for the response, but not sure how to use that info... probably I didn't explain what I am after very well, so I'll try to give a simpler example of the same thing... Imagine a large, standard SL cube prim (the root prim) with a small, linked sphere floating in front of it (the child prim). I zoom the camera close into the sphere and then get the camera position (CamPos) and camera rotation (CamRot) then store them. CamPos is stored as an X/Y/Z offset relative to the centre of the root prim using: CamOffset = CamPos - BoothPos; ...so if the root prim is moved, I can calculate the exact camera position later by adding this offset to the root prim position. (At the moment I'm storing CamRot unmodified as I'm not sure what I need to do). I take these two values later and use them to position the camera and set the 'look at target' using: CamFocus = CamPos + llRot2Fwd(CamRot); // Where Campos is BoothPos + the stored CamOffset If I move the above root prim all works well, but if I rotate the root prim, both the stored camera position and rotation is wrong (It is positioned and is pointing at the target where it was before the root prim was rotated). I need a little nudge in the right direction on how to store/retrieve the current camera position and angle to give the exact same zoomed view even if the root prim is moved and/or rotated. Maybe it's not possible...
  4. I'm making a photo booth which lets me store a number of camera positions via a HUD and switch between them. Once I have positioned the camera and 'lock' it, I store the camera position and rotation so I can put the camera back to the exact same location and rotation later, re-calculating the Focus. So far, so good... However, if the booth is moved or rotated, (or both), then the stored camera position and rotation are still pointing to the old target. Obviously I need to store the camera pos and rot relative to the pos and rot of the booth... but I can't get my head around whether the rotation is applied to the camera position before or after I store it. To fix this with respect to the position, I store the cam positions as X/Y/Z 'offsets' from the root prim's centre and store the cam's rotation 'as is', but although this works great if I move the booth, it doesn't work when I try to restore the camera if the booth has been rotated. Obviously the rotation of the booth has to be applied to the stored camera position and/or rotation. So far, neither works either multiplying or dividing the cam position by the booth's rotation... Should I even be storing the cam position as an offset from the root centre? Using this method does work if the booth is moved... but not when it is rotated. Do I have to take the booth's rotation into acount when storing the position of the camera as opposed to the cam's rotation... or both? To be honest, I'm confused at the moment so I may well be over-complicating things... In a nutshell... I want to position the camera looking zoomed in at say the head of someone sitting in the booth, store the camera data, then move and rotate the booth and still be able to put the cam back to give me the exact zoomed view. Many thanks in advance for any pointers - I don't mind figuring things out for myself, so specific code not required.
×
×
  • Create New...