howto make keystone with Blitz3d?

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

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?

Could copy the backbuffer to a texture, apply it to a quad, re-render showing the quad at an angle for perspective correction.

:) good but i am very new on Blitz..
can you give me a little example?

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.

This shows how to use CopyRect to copy the rendered scene onto a texture:
Graphics3D 800, 600, 0, 2
SetBuffer BackBuffer()

pivot = CreatePivot()

For i = 0 To 10

	cube = CreateCube(pivot)
	PositionEntity cube, Rnd(-5, 5), 0, Rnd(-5, 5)
	EntityColor cube, Rand(255), Rand(255), Rand(255)
	
Next
	
camera = CreateCamera()
MoveEntity camera, 0, 2, -15

keystone = CreateCube()
FlipMesh keystone
PositionEntity keystone, 0, 2, -15
EntityParent keystone, camera
ScaleEntity keystone, 5, 5, 5
EntityFX keystone, 1

tex = CreateTexture(512, 512)

Repeat

	HideEntity keystone
	ShowEntity pivot
	RenderWorld()
	
	CopyRect 144, 44, 512, 512, 0, 0, BackBuffer(), TextureBuffer(tex)
	EntityTexture keystone, tex
	
	ShowEntity keystone
	HideEntity pivot
	RenderWorld()
	
	If KeyDown(200) Then TurnEntity keystone,  1, 0, 0
	If KeyDown(208) Then TurnEntity keystone, -1, 0, 0
	If KeyDown(203) Then TurnEntity keystone,  0, -1, 0
	If KeyDown(205) Then TurnEntity keystone,  0, +1, 0
	
	Text 0, 0, "use cursor keys to turn cube"
	
	Flip
	
Until KeyHit(1)

End


so how do i deform the texture ?

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.

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..