having read the previous postings on cameras I am still not sure how to go about this. I want to have two different views of the same scene. Imagine you are standing in the street looking at your friend who is on the other side of the street and vice versa i.e. you friend can look back at you. I want to be able to switch between the two views i.e. you looking at your friend and your friend looking at you.
I guess it would be possible to do this, but I still havent got my head round cameras. How do you go about implementing :?
tomcat
If you don’t care about seeing the two views at the same time (split screen) just create a single camera node, and attach it to the player node and then detach and reattach to the friend node as needed.
OK, as right now the split screen is not too much an issue, this solution might work. Longer term would be better to have two cameras if it does not cause any major issues.
reading what you said, is this pseudo code what you have in mind?
create camera
create selfNode
create friendNode
create cameraNode
selfNode.attachChild(cameraNode)
sceneNode.attachChild(selfNode)
sceneNode.attachChild(friendNode)
//Ltes say on F1 and F2 press we change cameras
on F1 press
selfNode.detachChild(cameraNode)
friendNode.attachChild(cameraNode)
on F2 press
friendNode.detachChild(cameraNode)
selfNode.attachChild(cameraNode)
update as usual
how do I make sure that the camera faces me when its attached to the friend node?
tomact
Well, in this case, you are going to want your camera node to be facing forward (as it’s attached to a player node). So the camera will always face where the character models are facing. So, make sure your player/friend models are facing each other, and the camera will follow suit when attached.
Thx all. I look at implementing a simple test to see how it works.
tomcat