correct cubic environment mapping, how?

Blitz3D Forums/Blitz3D Programming/correct cubic environment mapping, how?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I don't have the source right here (new machine).

-Get X and Z from the main camera.
-Do a linepick from the main cameras position against the ground.
-Calculate main camera Y minus pickedY.
-Calculate pickedY minus the prev. calculations result, to get the Cube cam Y.
Now position the cube cam at this X,cubeY,Z and perform a 6 sided render for cubemapping as seen eg. in the cubed-Markio Demo.
             .game cam
          ______________________ground
  _______/
_/           °cube cam
-------------------- Zero



You see the distance from game cam to the ground is the same as from cube cam to the ground, only the cube cam is on the other side. Sorry if I explained it complicated :)

EDIT: btw. I'd also reccomend to use an optimzed cube-rendering function as seen in the code archives, that will use multiple cameras with side by side organized viewports to render all 6 sides with a single renderworld.