ok I here is my old code befor I ask if you could help dark coder
the camera is fixed but it will move at some point.
what I wont to know is how you got the mouse pointer to make objects at that exact position?
could you give an exarmple of code to help?
I know Im being a pain, but you could save me an epic amount of time.
here is what I did be for I asked you for help.
` ok I here is my old code befor I ask if you could help dark coder
` the camera is fixed but it will move at some point.
` what I wont to know is how you got the mouse pointer positons to make objects at that exact position?
` could you give an exarmple of code to help?
`*** use 1 2 & 3 to pick objects objects, left click mouse to make object, press space to delete all objects ***
sync on :sync rate 60
phy start
hide mouse
`set display mode 800,600,32
`*** camera setup ***
autocam off
position camera 0,0,80,-20 :`x625
xrotate camera 0,45
`*** mouse values
type Mouse_values
Mxpos# as integer
Mypos# as integer
Mzpos# as integer
Mxmove as float
Mymove as float
Mzmove as float
Mobjx# as integer
Mobjy# as integer
Mobjz# as integer
mouse_click as boolean
endtype
global Mouse as Mouse_values
`*** object values ***
type Object_Values
xpos# as integer
ypos# as integer
zpos# as integer
xang# as integer
yang# as integer
zang# as integer
xsize# as integer
ysize# as integer
zsize# as integer
red as float
green as float
blue as float
total_obj as float
Load_Object$ as string
Phy_Mesh$ as string
endtype
dim Array(1000) as Object_Values
`*** make a floor object ***
make object cube 1001,1
scale object 1001,50000,10,50000
position object 1001,0,-20,0
`color object 1001,rgb(255,0,0)
phy make rigid body static box 1001
`*** make mouse object ***
make object sphere 1002,10
`position object 1002,625,20,0
set object 1002,0,1,1
color object 1002,rgb(0,0,0)
`*** colour ink black ***
ink rgb(0,0,0),0
`*** start the loop ***
do
`randomize timer()
`*** mouse values ***
Mouse.mouse_click = mouseclick()
Mouse.Mxpos# = mousex()
Mouse.Mypos# = mousey()
Mouse.Mzpos# = mousez()
Mouse.Mxmove = mousemovex()
Mouse.Mymove = mousemovey()
Mouse.Mzmove = mousemovez()
`*** print outs ***
set cursor 0,20 : print "ues numbers 1 2 3 to change objects"
set cursor 0,40 : print "left click mouse to make an object"
set cursor 0,60 : print "press space to delete all object"
set cursor 0,80 : print "mouse x pos: ";Mouse.Mxpos#;" mouse y pos: ";Mouse.Mypos#
set cursor 0,100 : print "mouse move x: ";Mouse.Mxmove;" mouse move y: ";Mouse.Mymove
set cursor 0,120 : print "object made: ";Array(ID).Load_Object$
set cursor 0,140 : print "object number: ";ID
set cursor 0,160 : print "fps: ";screen fps()
`*** object picker ***
if scancode() = 2
ID_object_picker = 1
for c = 1 to 1000
Array(c).xsize# = 1000 :`XYZ size#
Array(c).ysize# = 1000
Array(c).zsize# = 1000
next c
endif
if scancode() = 3
ID_object_picker = 2
for c = 1 to 1000
Array(c).xsize# = 1250 :`XYZ size#
Array(c).ysize# = 1250
Array(c).zsize# = 1250
next c
endif
if scancode() = 4
ID_object_picker = 3
for c = 1 to 1000
Array(c).xsize# = 1100 :`XYZ size#
Array(c).ysize# = 1100
Array(c).zsize# = 1100
next c
endif
`*** mouse movement controls ***
if Mouse.Mxmove < 0
dec Mouse.Mobjx#,3
endif
if Mouse.Mxmove > 0
inc Mouse.Mobjx#,3
endif
if Mouse.Mymove < 0
dec Mouse.Mobjy#,3
endif
if Mouse.Mymove > 0
inc Mouse.Mobjy#,3
endif
`*** mouse pointer object ***
position object 1002,Mouse.Mobjx#,0,-Mouse.Mobjy#
`*** object colour picker ***
for c = 1 to 1000
Array(c).red = rnd(255) :`red colour
Array(c).green = rnd(255) :`green colour
Array(c).blue = rnd(255) :`blue colour
if object exist(c) = 1
Array(c).xpos# = object position x(c) :`XYZ pos#
Array(c).ypos# = object position y(c)
Array(c).zpos# = object position z(c)
Array(c).xang# = object angle x(c) :`XYZ ang#
Array(c).xang# = object angle x(c)
Array(c).xang# = object angle x(c)
endif
next c
`*** make objects ***
if Mouse.mouse_click = 1 then on_off = 1
if on_off = 1
inc ID_timer :`this is to count down the ID timer.
if ID_timer = 25 then ID_timer = 0 : on_off = 0 :`this is the swich off for the timer.
OldID = ID :`store the old ID number in OldID
if ID < 1000 and ID_timer = 1 then inc ID
if OldID < ID and ID_timer = 1 and ID_object_picker > 0
if object exist(ID) = 0
Load_Object(ID_object_picker,ID)
color object ID,rgb(Array(ID).red,Array(ID).green,Array(ID).blue)
position object ID,Array(ID).xpos#+Mouse.Mobjx#,Array(ID).ypos#,Array(ID).zpos#-Mouse.Mobjy#
scale object ID,Array(ID).xsize#,Array(ID).ysize#,Array(ID).zsize#
if ID_object_picker = 1 or ID_object_picker = 3 then phy make rigid body dynamic box ID
if ID_object_picker = 2 then phy make rigid body dynamic sphere ID
endif
endif
endif
`*** delete objects and reset scene ***
if spacekey()=1
for c = 1 to ID
if object exist(c) = 1
phy delete rigid body c
Array(c).xpos# = 0
Array(c).ypos# = 0
Array(c).zpos# = 0
delete object c
endif
next c
ID = 0
endif
phy update
sync
loop
`*** load object ***
function Load_Object(ID_object_picker,ID)
if ID_object_picker = 0 then exitfunction
if ID_object_picker = 1
make object cube ID,1
Array(ID).Load_Object$ = "Cube"
endif
if ID_object_picker = 2
make object sphere ID,1
Array(ID).Load_Object$ = "Sphere"
endif
if ID_object_picker = 3
make object cylinder ID,1
set object ID,1,1,0
Array(ID).Load_Object$ = "Cylinder"
endif
endfunction
as you can see I have removed the mouse cursor, but I plain to add it back in apone this fix for my code.
thanks for the help so fare dark coder.
I know you hard at work for this comp, and relly apreshate the help.
soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!