Timeline for XNA Arcball and moving model - the model is altered instead of the camera
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 12, 2013 at 20:41 | comment | added | Maarten Hartman | couldn't get it to work after 3 hours of trying.. I think it's a good idea to do this step by step, because, if I can control one axis, the remaining shouldn't be a big problem. I suggest we continue with the cameraArc(Y); right now if I change the cameraArc (when moving mouse up or down), the model 'bends' backwards or forwards, instead the camera should change to 'frog' or 'bird' view. Vielen dank for your help so far :) | |
Sep 12, 2013 at 9:51 | comment | added | Mario | Updated with a code example; not sure this will work though. :) | |
Sep 12, 2013 at 9:51 | history | edited | Mario | CC BY-SA 3.0 |
added 1090 characters in body
|
Sep 11, 2013 at 11:06 | comment | added | Maarten Hartman | yeah exactly, logically (I think) this should happen in the updatecamera(), can you see where I'm (not) doing this? If you will or have could you post some sample code? | |
Sep 11, 2013 at 8:51 | comment | added | Mario | Sounds like you're transforming the wrong matrix (the one used for the model rather than the one used for the camera). | |
Sep 10, 2013 at 23:42 | comment | added | Maarten Hartman | hmm after hours attempting to get this to work, I get back to the community. No matter what I do, the model is always rotated instead of the camera. Is this approach correct? It looks like I need to 'separate' the camera from the model (it behaves like the camera IS the model..), but then the camera wont follow the model. Please assist again. | |
Sep 9, 2013 at 22:50 | comment | added | Mario |
You'd calculate your view matrix using Matrix.CreateLookAt(posCam, posTarget, new Vector3(0.0f, 1.0f, 0.0f)); only. More details can be found here.
|
|
Sep 9, 2013 at 22:43 | comment | added | Maarten Hartman | hmm.. so I have to transform this line? "Vector3 positionOffset = Vector3.Transform(CameraPositionOffset, cameraFacingMatrix);" I use this line to change the x axis: "cameraRotation -= xDifference * 1.05f;" How can I do this the correct way? | |
Sep 9, 2013 at 22:32 | comment | added | Mario |
If I haven't made some mistake, you'd just have to rotate CameraPositionOffset and then add it as you did before. You shouldn't have to worry about the camera's rotation as you can use LookAt() for that.
|
|
Sep 9, 2013 at 22:27 | comment | added | Maarten Hartman | thanks for your help Mario. I guess I should implement your suggestions in the updateCamera method? Could you help me rewrite this? (if it doesn't cost you more than a few minutes) | |
Sep 9, 2013 at 22:13 | history | answered | Mario | CC BY-SA 3.0 |