PDA

View Full Version : Camera looking thru camera - can it be done?



KShots
11-15-2002, 10:34 AM
I'm trying to do an odd scene: Picture a viewscreen on some spaceship showing different angles outside the ship, but on a large screen (low res is ok)...meanwhile, the ship may be moving, and your own character may move around the moving ship. Can this be done?

Just looking for how to implement the viewscreen http://www.opengl.org/discussion_boards/ubb/smile.gif.

bodros
11-15-2002, 11:22 AM
You could use the rotations and translations that the ship goes through for the player to position him in the ship (like you would when the player is motionless within the ship) and then add rotations and translations that move the player. so:


model plr locally
model ship locally (don't forget plr pos in ship)
model plr same as ship
place plr in ship by translating plr
origin to plr pos in ship.
world model

Thay way, both ship modelling and local plr modelling apply to the plr, and if the plr walks away from local origin it'll be like walking away from the plr pos in the ship.

hope it makes some sense

ps. there are alot of ways to reach this I think

nexusone
11-15-2002, 11:36 AM
Yes, you can have diffrent views.
Look at Nate Robins openGL tutor, link on my website for it.
http://www.angelfire.com/linux/nexusone/


Originally posted by KShots:
I'm trying to do an odd scene: Picture a viewscreen on some spaceship showing different angles outside the ship, but on a large screen (low res is ok)...meanwhile, the ship may be moving, and your own character may move around the moving ship. Can this be done?

Just looking for how to implement the viewscreen http://www.opengl.org/discussion_boards/ubb/smile.gif.

bodros
11-15-2002, 12:08 PM
Ah, I now see I was answering a different question then yours. The viewing was the prob - *doh*

Jambolo
11-17-2002, 11:05 AM
Search for this: "render to texture". That's what you want to do, right? Render some other view onto a texture and then apply the texture to the viewscreen.

KShots
11-17-2002, 11:44 AM
Yeah, you're right. I think I've found a tutorial to do this. Thanks!