Languages & Coding > Blitz2D, BlitzPlus, Blitz3D

Blitz NG - Camera Problem


Hi all, I'm trying to use this old camera code from 2003 and it works, but it doesn't point at the entity center. I'm just posting this as a bug report I guess, not sure where else to put it. It works correctly in regular old Blitz3d but not quite right in Blitz3d NG, the camera points to the left of the entity. You can paste it directly and run it to test it out, what you think about this Rontek?:

--- Code:  (Unknown Language) ---; SuperCam!;; by PsychicParrot 2003;;; Usage : SuperCam(cam,ent,cspeed#,dist#,hite#,xrot#,tilt#);; Graphics3D 640,480,16,3SetBuffer=BackBuffer() Global campivot=CreateCube() ; create pivot for cameraGlobal camera=CreateCamera()  ; create camera (!!!) ; ---------------------- THIS IS ALL JUST TO POPULATE THE WORLD WITH SOME RUBBISH --------------- Global light=CreateLight()Global player=CreateCube()    ; create simple playerGlobal plane=CreatePlane()   ; create simple floorMoveEntity player,0,1,0; Create texture of size 256x256tex=CreateTexture(256,256) ; Set buffer - texture bufferSetBuffer TextureBuffer(tex) ; Clear texture buffer with background white colorFor i=1 To 10Color Rnd(0,255),Rnd(0,255),Rnd(0,255)Rect Rnd(0,256),Rnd(0,256),Rnd(0,256),Rnd(0,256)Next ; Texture cube with textureEntityTexture plane,texEntityTexture player,tex ; Set buffer - backbufferSetBuffer BackBuffer() ; ---------------------------------------------------------------------------------------------- While Not KeyHit(1) If KeyDown(200) Then        MoveEntity player,0,0,.2End If If KeyDown(203) TurnEntity player,0,1,0If KeyDown(205) TurnEntity player,0,-1,0 SuperCam(camera,player,.02,6,2,12,0) RenderWorldFlip Wend End Function SuperCam(cam,ent,cspeed#,dist#,height#,xrot#,tilt#) TFormPoint 0,height#,-dist#,ent,0 cx#=(TFormedX()-EntityX(cam))*cspeed#cy#=(TFormedY()-EntityY(cam))*cspeed#cz#=(TFormedZ()-EntityZ(cam))*cspeed# TranslateEntity cam,cx,cy,czPointEntity cam,entRotateEntity cam,xrot#,EntityYaw(cam),tilt# End Function  


[0] Message Index

Go to full version