A question about planes (infinite floors)

Blitz3D Forums/Blitz3D Programming/A question about planes (infinite floors)

SkyCube(Posted 2005) [#1]
Hello,

I am new to BlitzBasic (and I think it's the greatest development tool ever made :)). I have a question concerning planes, the infinite floors create by the CreatePlane() function. I have my floor and I textured it and the "basic" camera movement code, like this:

If KeyDown(203) RotateEntity camera,0,1,0 ;left
If KeyDown(205) RotateEntity camera,0,-1,0 ;Right
If KeyDown(200) Then MoveEntity camera,0,0,1 ;forward
If KeyDown(208) Then MoveEntity camera,0,0,1 ;back

The camera moves as it it supposed to, but the texture on the floor moves sideways when I walk forward!! Is there a reason/solution for this? Thanks!


_PJ_(Posted 2005) [#2]
Is your Texture repetitive?

It may be just an optical illusion that appears to be moving sideways because of the movement of the camera and positioning of the texture 'tiles'

Try making the step sizes MUCH smaller, see if this looks like the movement is in the correct direction perhaps:



(PLUS: fixed back/forwards 'negative' error!)
(EDITED: WolRon pointed out something I completely missed hehe)


WolRon(Posted 2005) [#3]
MoveEntity moves entities in relation to their LOCAL coordinates. If you've rotated the camera with the RotateEntity command 1 degree, then moving the camera forward/back will cause it to move at a slight angle to the 'world', which may be what you are witnessing.

Just so you know, the RotateEntity command moves the entity an absolute amount, meaning that in your code example above, if you press (say) left, your entity will instantly rotate to the left one time. Every time you press the left button after that, nothing will change because your entity is already at that rotation (0,1,0).
If you want it to continue rotating, then you need to use the TurnEntity command.

Absolute commands:
PositionEntity
RotateEntity

Incremental commands:
MoveEntity
TurnEntity


SkyCube(Posted 2005) [#4]
Hey thanks Malice! It was what you said, a visual effect that made it seem to be going sideways. I also saw what you mean, WolRon. I had the same "problem" you described. When I used RotateEntity, it only moved once, but I fixed it. Thanks!!