off-axis projection/rendering

G

golgo32

Guest
Hi Everyone,

Is it possible to do off-axis rendering through the source sdk, ie
where the view (look at) direction is not perpendicular to the near
plane? I've looked at the various view-related .h and .cpp files and
haven't found anything that would work. Am I missing something or is
this just one of the limitations of the sdk?

Thanks,
-Andrew
 
Could you make a diagram? Because I read that and went D:

-Angry Lawyer
 
hehe...sorry. a picture is worth a thousand words.

In most graphics applications, the view frustum looks something like this, from a birds-eye view

Code:
---------    near plane
.       .
 .     .                               ^
  .   .                                |  view/look at direction is perpendicular to 
   . .                                 |  the near plane
    .   camera center

in off-axis projection, the view frustum is warped so that it looks something like ...
Code:
---------    near plane
.       .
.     .                             ^
.   .                              / view/look at direction 
. .                               /  
.   camera center

or

Code:
---------    near plane
.       .
  .     .                             ^
    .   .                              \ view/look at direction 
      . .                               \   
        .   camera center

or even

Code:
---------    near plane
.        .
   .      .                             
      .    .                               
         .  .                                 
             .   camera center

off-axis projection is typically used in VR applications like the CAVE, where you need to warp the view so that it looks right from the perspective of the person in the CAVE.

-Andrew
 
Hmm, it sounds like it could be engine related. But a quick fix likely would be found in the various camera files. I've never really played with views in such an odd way, but a quick look at the "How to do third person" tutorials would likely help you out with a few of the camera orientation bits.

-Angry Lawyer
 
im not sure if i understand you exactly but if you change the pitch in in_camera.cpp to about 50 that might be what your looking for. also if i understand what your plannig on doing surely that will only create an illusion of depth if the player is crosseyed or wearing special glasses?
 
Thanks guys, I'll look into the pitch setting.

on a side note, what I'm talking about doing is independent of a sense of depth. Combine this with stereo rendering (with something like shutter glasses) and you get a really nice depth effect.

What I'm talking about is used for creating the window-into-the-world effect.
Pretend for a minute that your monitor is a window. The window doesn't move. It's stuck in space, and just beyond the window is the game world. As you move your head to the left, you'd expect to see more of the right side of the game world. If you move your head to the right, you'd expect the opposite. This is different than what you usually see in most games. Usually the window actually moves with you as walk around.

Here's a diagram which may or may not help explain what I'm talking about.

Code:
          .                          .
          .                       .
          .                 O  .  
          .                 .
left edge |-----------o--| right edge of monitor
          .            .    or projector
          .        .
          .    .
          .
             your head position

O -- some 3d point in the world
o -- 2d projection of the 3d point onto the monitor

-Andrew
 
right im still a tad confused about that :D but yeah try having a pitch of -50 and +50.
 
Imagine looking at a NPC in a FPS.
Sidestep so he's just off your screen on the left.

With what he;s doing you can move your head to the right, and u'd see him (just like looking at a friend out of a window).

If you want to see more to the left of the street (or whatever) when you look out of the window you could move ur head to the right! That's what he's talking about/
 
Yeah, it's a very cool effect when you try on a big wall with a projector. I wish I could explain it better, or could find a good link on the topic.

Unfortunately, I don't think it's possible through the SDK. Modifying the pitch will rotate the view, but the shape of the view frustum will stay the same. What I really need to do is warp the view frustum. but As far I can tell there's no way to specify my own frustum.

-Andrew
 
You could send an e-mail to one of the Valve coders, as they're usually interested in really crazy coding ideas, and are often willing to help.

-Angry Lawyer
 
Individual coder would work best. I'm not sure of the address, though, or who in specific. Jay Stelley's your best bet, though.

-Angry Lawyer
 
Back
Top