i know that... but it doesn't move along the z axis like i want it to with it like that with the code i originally had before my alterations
this is one of the reasons why i'm asking for some guidance on the matter.
anyway... problem sorted. i remembered a video i saw on youtube about a dark ai tutorial and it had a mouse code in it. thought i'd give it a whirl and what do you know. it works perfectly.
pick screen mousex(),mousey(),100
vx# = get pick vector x()
vy# = get pick vector y()
vz# = get pick vector z()
dy# = - camera position y()/vy#
vx# = vx#*dy# + camera position x()
vz# = vz#*dy# + camera position z()
position object 1,vx#,1,vz#
and it doesn't matter where you point the camera either which is a bonus.
now to try and fix the camera issue. How can i get my camera to point where i want it when i hold down the right mouse button.
this is the code i've got atm but
1)its erratic when you move the mouse quite a way and press the mouse button; and
2) i know its not quite right
IF mouseclick() = 2
x#=x#+mousemovey() : y#=y#+mousemovex() : rotate camera 0,x#,y#,0
ENDIF
i'll do some hunting for a solution presuming there is one out there for this. if i can get this nailed with your help i'll gladly put the full code up for you to use.
also i'll need a way of zooming in.
[Edit]
ok i had a look around the search and found mouse looks for FPS and 3rd person but nothing for a free mouse look.
i've used the following codes and they work, but not in the way i would like them to.
IF mouseclick() = 2
XAngle# = wrapvalue(camera angle x() + 180.0) + mousemovey()
if XAngle# < 90.0 then XAngle# = 90.0
if XAngle# > 270.0 then XAngle# = 270.0
XAngle# = wrapvalue(XAngle# - 180.0)
YAngle# = wrapvalue(camera angle y() + mousemovex())
rotate camera XAngle#, YAngle#, 0
ENDIF
and i gave this a try
IF mouseclick() = 2
inc cax#,mousemovey()
inc cay#,mousemovex()
rotate camera wrapvalue(cax#),wrapvalue(cay#),0
ENDIF
turns out they are both the same in the way they perform. adding a /5 in the second one does help make things a little less twitchy, but if i move my mouse substantially to the left or right it flicks to that point. thats the bit i can't figure out how to stop from happening.
PC spec: AMD Phemon II X4 940@ 3Ghz, 8Gb DDR2 Ram, 1x 60Gb SSD and 2x 500 gb HDD, GForce STX260 876Mb, Windows 7 64bit