View previous topic :: View next topic |
Author |
Message |
Team Xlink
Joined: 25 Jun 2009 Posts: 320
|
Posted: Mon Feb 01, 2010 2:34 am Post subject: Birds Eye Camera & Rotating Camera & In Game Securit |
|
|
Hello.
I have three questions today.
How would I go about creating a birds eye view type camera via engine code?
We can move the chasecam view in all directions. Has anyone made one that rotates around and above/below the player on all axis's.
This last question is something I think isn't going to be very likely.
I want to do this:
I want to have in game security camera type "things".
Where you would have the "camera" be it an entity or what not and then whatever that sees you see on a "screen" somewhere else in the map. _________________
Anonymous wrote: | if it works, it works. if it doesn't, HAHAHA! |
|
|
Back to top |
|
 |
Downsider

Joined: 16 Sep 2008 Posts: 478
|
Posted: Mon Feb 01, 2010 5:18 am Post subject: |
|
|
For the security camera thing, look at the reflection code for an example as to how something like that would work. You would also look at the functions for rendering to a texture on whatever API you're working with.
As far as a bird's eye view goes, it's just some simple math and collisiony stuff to move the camera to the correct position; it's not complicated.. An algorithm to find the angle between two points in 3d space seems like all you would need. Then just chuck the chase camera at any position and face it toward the point of interest. |
|
Back to top |
|
 |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Mon Feb 01, 2010 12:01 pm Post subject: Re: Birds Eye Camera & Rotating Camera & In Game Sec |
|
|
Team Xlink wrote: | Hello.
I have three questions today.
How would I go about creating a birds eye view type camera via engine code? |
Frag Machine's chasecam engine tutorial would be a good start:
http://forums.inside3d.com/viewtopic.php?t=1158
Although what you want sounds more the QuakeC department.
Quote: | We can move the chasecam view in all directions. Has anyone made one that rotates around and above/below the player on all axis's. |
Probably a DarkPlaces mod has done this. But it would likely require one of the veteran QuakeC modders to identify an example mod.
Quote: | This last question is something I think isn't going to be very likely.
I want to do this:
I want to have in game security camera type "things".
Where you would have the "camera" be it an entity or what not and then whatever that sees you see on a "screen" somewhere else in the map. |
That feature exists in RQP (RuneQuake Plus) as far as I know. I can't remember the name of the rune but you could press a key to look from the point of view of the trap.
Zerstorer also had cut scenes.
Here are the source codes, respectively:
http://www.quake-1.com/quakec-gallery/RQP_0.5.4.zip
http://www.gamers.org/pub/idgames2/partial_conversions/zerstoerer/
Edit: Didn't the that "security screen thing". Hmmm. Well, I guess you could make a 2nd R_RenderView pass and then play around like Downsider suggested with some sort of render to texture function. Really that would be cool as hell to pull off. _________________ Tomorrow Never Dies. I feel this Tomorrow knocking on the door ... |
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Mon Feb 01, 2010 1:59 pm Post subject: Re: Birds Eye Camera & Rotating Camera & In Game Sec |
|
|
Team Xlink wrote: | Hello.
I have three questions today.
How would I go about creating a birds eye view type camera via engine code?
|
Look of the svc_ to change the camera pos from QC. then do it, but from C.
Quote: |
We can move the chasecam view in all directions. Has anyone made one that rotates around and above/below the player on all axis's.
|
I think I did this with Telejano. But maybe on a half-assed way, I don't remenbet.
Quote: |
This last question is something I think isn't going to be very likely.
I want to do this:
I want to have in game security camera type "things".
Where you would have the "camera" be it an entity or what not and then whatever that sees you see on a "screen" somewhere else in the map. |
Theres a console commnad for that in Telejano (chase_on 3 ?). But is very doable in QC with simple code. |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Mon Feb 01, 2010 2:25 pm Post subject: |
|
|
if you want a usable birds eye view, you need to retain the player's angles.
Create an entity, make its position follow behind the player, its angles don't matter. It needs to be floating with some kind of angle behind.
use svc_setview(byte:5, entity:newviewpoint) to change their viewpoint to be from the new camera.
force the client's m_pitch cvar to 0. This will stop them from pivoting with the mouse. force +mlook otherwise their client will attempt to center their view.
use fixangles and enforce a downwards angle should it ever leave the accepted range (remember angles have a precision of 256 graduations for a full circle, so be leanient).
In prethink and postthink, force the pitch (v_angle_x) 0 and reset it again in postthink. Update the view entity's position in postthink.
Make sure the old (vertical-only) autoaim builtin works.
After you've done that, you'll end up with a floating camera with a birds eye view. Your player will run around freely using regular player physics, their shots will travel horizontally unless there's something infront in which case the shots will autoaim vertically to hit as needed. They will not be able to change the pitch of the camera at all, but they can freely use the mouse to change their player's angles without accidentily breaking the pitch. This method will work in any (non-broken) NQ engine. _________________ What's a signature? |
|
Back to top |
|
 |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Tue Feb 02, 2010 2:46 pm Post subject: |
|
|
Nehe OpenGL Render To Texture
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=36
Although I think a better solution would be a R_RenderView pass but that'd be incredibly complicated. I'm not sure how in OpenGL you could set an angled viewport to align with a brush face somewhere with a special texture name? _________________ Tomorrow Never Dies. I feel this Tomorrow knocking on the door ... |
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Tue Feb 02, 2010 4:35 pm Post subject: |
|
|
splitscreen hack.
ftp://ftp.berlios.de/pub/telejano/splitcreenhack2.zip
theres a cvar to rotate the 2th view
thats was poorly done, because no lights on the 2th screen.
potential problems:
- lighting (dynamic lights off, like on this hack)
- PVS (2th camera outside of the PVS, see no entities)
- map compiled with different aspect ratio (only a problem on this hack) |
|
Back to top |
|
 |
Downsider

Joined: 16 Sep 2008 Posts: 478
|
Posted: Tue Feb 02, 2010 10:26 pm Post subject: |
|
|
Teiman wrote: | splitscreen hack.
ftp://ftp.berlios.de/pub/telejano/splitcreenhack2.zip
theres a cvar to rotate the 2th view
thats was poorly done, because no lights on the 2th screen.
potential problems:
- lighting (dynamic lights off, like on this hack)
- PVS (2th camera outside of the PVS, see no entities)
- map compiled with different aspect ratio (only a problem on this hack) |
Isn't PVS reloaded for reflections? Because what if it reflects down a corridor? If you simply take the reflection code and modify it, it should avoid the PVS problem. |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Wed Feb 03, 2010 9:57 am Post subject: |
|
|
its the server that filters entities out by pvs. The client generally draws all ents. _________________ What's a signature? |
|
Back to top |
|
 |
|