Does it have to be a pixel, or can it be a small sphere (an object) that looks like a pixel? You are using vectors and 3D, but a pixel is drawn using 2D coordinates is why I ask.
Anyway, I made a very small sphere and placed it inside a cube that is being displayed as a wireframe. I adjusted the screen coordinates based upon where I set the camera, so the 'pixel' appears to stay within the objects' boundaries (it really doesn't, but from the perspective given, it appears that way).
I don't know that this is what you are looking for, but I hope it helps.
` set up
sync on
sync rate 60
backdrop on : color backdrop 0
autocam off : randomize timer()
` consts you have when you don't have consts
global const SCREEN_X as float = 500.0
global SCREEN_Y as float = 500.0
set window on
set window position 0,0
set display mode SCREEN_X,SCREEN_Y, 32
set window size SCREEN_X + 10 ,SCREEN_Y + 10
position camera 0,10,-150
point camera 0,0,0
`types
TYPE Vect2
x AS FLOAT : y AS FLOAT : z as float
speed as float : Xvel as float : YVel as float
direction
MaxLeft as float : MaxRight as float
MaxUp as float : MaxDown as float
ENDTYPE
` game data
ball AS Vect2
ball.x = 0.0
ball.y = 0.0
ball.z = 0.0
ball.speed = 2.0
ball.XVel = 0.3
ball.YVel = 0.2
ball.MaxUp = 34.0
ball.MaxDown = -40.0
ball.MaxLeft = -37.0
ball.MaxRight = 37.0
make object sphere 99,1
make object cube 100,60
set object wireframe 100,1
` game loop
while escapekey() = 0
` delta time is time between frames
dt AS FLOAT = 0
IF SCREEN FPS() <> 0
dt = SCREEN FPS()
dt = 1.0 / dt
ENDIF
`move the ball
ball.x = ball.x + ball.XVel
ball.y = ball.y + ball.YVel
`render the ball
position object 99,ball.x, ball.y,0.0
if ball.x > ball.MaxRight
ball.XVel = ball.XVel * -1
endif
if ball.y > ball.MaxUp
ball.YVel = ball.Yvel * -1
endif
if ball.y < ball.MaxDown
ball.YVel = ball.Yvel * -1
endif
if ball.x < ball.MaxLeft
ball.XVel = ball.XVel * -1
endif
sync
endwhile
end
LB