That’s what I was afraid of… Mirroring camera or cursor movements…
Can’t this be done by attaching light to a node? Can’t I use something like Light Node (I found this thing somewhere but seems to be working with Point Light and not with Spot Light - unless I do something wrong of course).
a) Because that’s the only way of custom camera controls that someone was nice enough to present to me in details in another topic some time ago. I’m new to this 3d stuff so for now I’m basing everything on the few tutorials available and nice poeple on the forums
b) Because of the ability to attach objects to that “Camera” in the future.
[EDIT] Great thanks, it works in init (I see a light) so it probably will work in update loop as well Btw. it seems to be WorldTranslation not WorldLocation. As for cursor - how You do that? I mean there seems to be no default object like “cursor” in Jmonkey…
Funny thing - Light pushed into update loop have this strange effect of “painting” over the objects. Permanently! I mean wherever it goes becomes white but doesn’t become normal when I point light in different direction… What’s going on?
[EDIT] False alarm - I managed to get rid of this effect by decalring light outside any function and splitting it’s code between init and update.
[EDIT 2] Af for cursor position there is little trouble. I tried to use inputManager.getCursorPosition() but it’s output is 2f vector, and setPosition requires 3f vector. How do I marry those two? I found some conversion method on the tutorials but they wont work because they use cam (default FPS camera) to get world position. In my case mouse cursor and camera move separately…
I dont know about normen, but I am not sure on what you want.
You want an headlamp ? Or you want the ray intersection of your mouse to be an lamp ?
If its the fist case, attach the lamp to the camera Node.
In the second case, use rays intersection, there is an example how to do it in the test cases.
Pls. don’t think in FPS camera terms. As for Your question the answer is: neither. I need free moving mouse cursor (which I already have simply by disabling default FlyByCamera) to be the lamp. Where cursor is there should be light. Cursor moves, light folows, camera stays stationary. That’s what I need.
And all examples out there assume either FPS or TPS both of which are useless to me.
Problem is that built-in function to get mouse coordinates gives numbers in screen-relative scale (2 dimensions) and I need 3d world-relative mouse coordinates. Need to translate one to the other (based only on cursor location).