I'm working on an object selection, and pan around system that operates much like a third person camera, I want to be able to go around the object on all axis, I got X and Z done, but i'm having trouble with Y, here's my toned down code, can someone please help?
Rem Project: Editor Alpha
Rem Created: 4/3/2003 8:55:04 PM
Rem Creator: Tyler Drinkard
Rem ***** Main Source File *****
sync on : sync rate 100
set display mode 800,600,16
set camera view 0,0,700,500
make matrix 1, 300, 300, 10, 10
update matrix 1
make object sphere 1, 2
position object 1, 150, 0, 150
PointCamX#=object position x(1)
PointCamY#=object position y(1)
PointCamZ#=object position z(1)
position camera PointCamX#-10, 15, PointCamZ#
point camera PointCamX#, PointCamY#, PointCamZ#
do
rem --------- Decisions ----------
if keystate(56)=1 or keystate(184)=1
if mouseclick()=1
camobjY# = Object angle Y(1)
camobjX# = Object angle X(1)
PointCamX#=object position x(1)
PointCamY#=object position y(1)
PointCamZ#=object position z(1)
Yrotate object 1, Wrapvalue(camobjY#+MouseMoveX()*.2)
Xrotate object 1, Wrapvalue(camobjX#+MouseMoveY()*.2)
set cursor 0,0
print "Mouse Clicked"
cY# = Newyvalue(PointCamY#,camobjX#+180,20)
cX# = Newxvalue(PointCamX#,camobjY#+180,20)
cZ# = Newzvalue(PointCamZ#,camobjY#+180,20)
Position Camera cX#,cY#,cZ#
Point Camera PointCamX#, PointCamY#, PointCamZ#
endif
endif
sync
loop
P.S. This is what the alphabet would look like if Q and R were eliminated.