Right. I've been doing some tests. What I want to achieve is to render the screen onto a plane that I can manipulate, and it works, but I can't grasp some of the things involved here.
Changing the size of the RenderImage does unexpected things, and the plane itself. Also I appear to get multiple versions of the screen pasted onto the plane because when I change the angle of the plane artifacts appear as if there are mirrored versions behind or in the plane.
About the sizing of the renderimage and the plane to display on. If I make the renderImage bigger, it doesn't all display on the plane no matter if I also make the plane bigger.
Code
Setup:
function load()
global fullScreenShaderImg as integer
fullScreenShaderImg = createRenderImage(640, 480, 0, 0 )
global renderPlane as integer
renderPlane = createObjectPlane(640, 480)
setObjectPosition(renderPlane, 0, 0, 0)
setCameraPosition(1, 0, 0, -700)
setCameraLookAt(1, 0, 0, 0, 0)
endFunction
The main loop:
function play()
board = loadSprite("planetest.png")
setSpriteSize(board, 960, 960)
setSpritePositionbyOffset(board, half_width, half_height)
global planeAngleX# as float
global planeAngleY# as float
global planeAngleXTarget as integer
global planeAngleYTarget as integer
do
getInput()
controlBoard()
renderToPlane()
currentFrameTime# = getFrameTime()
loop
endFunction
My render to plane function:
function renderToPlane()
update(0)
setRenderToImage(fullScreenShaderImg, 0)
clearScreen()
render()
setObjectImage(renderPlane, fullScreenShaderImg, 0)
setRenderToScreen()
drawObject(renderPlane)
swap()
endFunction
Some general understanding on what is going on here would be nice. I can't figure it out by testing because it behaves illogical to me.
My hovercraft is full of eels