howto make keystone with Blitz3d?

Blitz3D Forums/Blitz3D Programming/howto make keystone with Blitz3d?

Raistlin(Posted 2007) [#1]
i have a projector at the ceiling of a room.
and projecting the 3d animation to the floor.
but if i put the projector with an angle , the animation on the floor becomes deformed. so i am using projector's keystone function , but it is not good enough.
how can i deform output (keystone) with blitz3d?


GfK(Posted 2007) [#2]
Could copy the backbuffer to a texture, apply it to a quad, re-render showing the quad at an angle for perspective correction.


Raistlin(Posted 2007) [#3]
:) good but i am very new on Blitz..
can you give me a little example?


GfK(Posted 2007) [#4]
I don't have Blitz3D installed any more as I've been using Blitzmax for the last year or so.

I *think* there's a sample game called Insectoids that comes with the Blitz3D samples, which renders the game screen to a texture and applies it to a cube. Maybe that will get you going in the right direction as the principle is the same.


b32(Posted 2007) [#5]
This shows how to use CopyRect to copy the rendered scene onto a texture:



Raistlin(Posted 2007) [#6]
so how do i deform the texture ?


GfK(Posted 2007) [#7]
You don't deform the texture - you rotate the object that the texture is applied to. Perspective means that the object (and therefore the texture applied to the object) will appear narrower at the top of the screen than it does at the bottom, for example.

For your purposes you need to rotate it on the X axis. Use cursor up/down in the above code to demonstrate the effect.


Raistlin(Posted 2007) [#8]
great thank you..
i'll work on it :)
i am working on an interactive project
i am using vb.net 2005 and using mmEngine.dll
which lets us to use all Blitz functions in vb.net
it has its own window and all actions work on this dll.
i have a webcam controlled with vb.net , the webcam and the projector are at the ceiling of the room
i am detecting the movements who walks under it
and convert the coordinates of the movements to x,y
then i am interacting it with Blitz animations
before Blitz and mmengine.dll i was using directx , it is very difficult to use. so we turned to Blitz.

thank you for your suggestions..
i'll work on it..