help with rendering to texture

Blitz3D Forums/Blitz3D Programming/help with rendering to texture

mtnhome3d(Posted 2008) [#1]
hi I'm having problems with rendering to a texture and collisions.
here's what i got
While Not KeyHit(1)
Cls
If KeyHit(19) Stop;WireFrame True;

updatebul()
updatechar()
;updateenemy()
updatehud()
UpdateWorld
HideEntity cam
ShowEntity overheadcam
RenderWorld
CopyRect 0,0,128,128,0,0,0,TextureBuffer( radtex )
ShowEntity cam
HideEntity overheadcam
RenderWorld

Text 0,0,TrisRendered()+"   ",0,0
WaitTimer(fpstimer)
Flip
Wend
End 


theres my mainloop
and heres my update with the collisions
If EntityCollided(c\e,weapon1)
c\wepf=c\wepf+1
FreeEntity gun4
ShowEntity gun5

the gun is global

If I comment out the render to texture part in the loop it works fine but if i don't it wont detect the collision
but other collisions work fine
the c\e is a camera with a radius of 5


Stevie G(Posted 2008) [#2]
You're not defining a source buffer, so this ...

CopyRect 0,0,128,128,0,0,0,TextureBuffer( radtex )

Should be this ...

CopyRect 0,0,128,128,0,0,backbuffer(),TextureBuffer( radtex )

This should have no effect on collisions but if you need help with that post your definitions etc... or some working code.

Stevie


mtnhome3d(Posted 2008) [#3]
actually I fixed it. It was a problem with the hiding and showing of the "cam" camera, for some reason it hid it when the collsions happened or something. but thanks for the help.

>> edit
if you want see my code Click here!


jfk EO-11110(Posted 2008) [#4]
Hiding an entity will erase its collision stack, maybe this was the problem. You may also use CameraProjMode to deactivate a camera temporarily


mtnhome3d(Posted 2008) [#5]
thanks jfk.
any comments on the code are welcome cause i have no clue if this is correct. it just works, mostly.