POINTENTITY

Blitz3D Forums/Blitz3D Programming/POINTENTITY

Naughty Alien(Posted 2006) [#1]
How to stop it? I mean, I apply PointEntity MyCamera,Wall, and then I want MyCamera bee free from an pointing on to Wall entity? How?


Steven Noyce(Posted 2006) [#2]
Not sure if you mean what I think you mean, but if you don't call pointentity then it won't point at it and will therefore be "free from any pointing".

Here is some code to demonstrate.
Graphics3D 640,480
SetBuffer BackBuffer()

cone=CreateCone()
RotateMesh cone,90,0,0
cube=CreateCube()
point=True

camera=CreateCamera()
PositionEntity camera,0,20,0
PointEntity camera,cone

While Not KeyDown(1)

If KeyHit(57) Then point=point*-1
If point=True Then PointEntity cone,cube
If KeyDown(200) Then MoveEntity cube,0,0,.25
If KeyDown(208) Then MoveEntity cube,0,0,-.25
If KeyDown(203) Then MoveEntity cube,-.25,0,0
If KeyDown(205) Then MoveEntity cube,.25,0,0

UpdateWorld
RenderWorld
Text 0,0,"use arrows to move cube, press space to toggle pointing"
Flip
Wend
End



n8r2k(Posted 2006) [#3]
maybe befor you use point entity, create a pivot just infront of where you are looking now then after pointing at the wall, use point entity again this time at the pivot. I am not sure that would work, as i am not very experienced but it sounds like it would, anyone else?


lo-tekk(Posted 2006) [#4]
Wild guess: take it out of the loop ?


Ross C(Posted 2006) [#5]
I'm not sure what you mean here. If you point your camera at the wall, it will simply rotate the camera to face the wall once. Unless you repeated call it.


n8r2k(Posted 2006) [#6]
I think he means he wants to have like a keyhit that focuses his camera on a wall, then another command to move the camera back to where it was pointing before he called pointentity. Am i right about this?


Picklesworth(Posted 2006) [#7]
If so, store initial camera rotation in 3 float variables using EntityPitch(), EntityYay(), and EntityRoll()


n8r2k(Posted 2006) [#8]
*slaps myself silly*

thats a much better way. Thanks you mr. pickelsworth,


_PJ_(Posted 2006) [#9]
If KeyHit(57) Then Point=(1-Point)