So I had it in my head a while ago that I would quickly understand all aspects of the vertexdata commands... HA. I was trying way back when, to make drawable roads like you'd find in sc4 and the newer CitiesXL
http://www.citiesxl.com, but couldn't grasp the idea. The same can't be said this morning. I FIGURED THE S#$@ out! What I need help with is when you draw the roads (there is some math involved with this that ugh-um... I don't understand) the remaining unaltered vertex's don't rotate in the direction you are moving the road to. (IE, the point opposite the roads end you're dragging) I need some help figuring it out. I know that it would rotate around a point the same distance from the road as the roads width... but what is the math I should use (or invest my time understanding)Anyone with any information and knowledge is a big help-
D.
Set display mode desktop width(),Desktop Height(),32
Autocam off
Make Camera 1
Set current camera 1
color backdrop RGB(0,0,0)
Make object plane 1,1000,1000
position object 1,500,500,0
Position camera 500,500,1250
Point camera object position X(1), Object position Y(1), Object position Z(1)
A#=0
Road=2
Do
`3d mouse click dependants:
wx#=px#+camera position x()
wy#=py#+camera position y()
wz#=pz#+camera position z()
IR#=Pick Object (mouseX(), MouseY(), 1,1)
H#=Get pick distance()
PX#=Get pick vector X()
PY#=Get pick vector Y()
PZ#=Get pick vector Z()
CX#= Camera position X()
CY#=Camera Position y()
CZ#=Camera Position Z()
Set text opaque
Set cursor 10,10
R#=Pick Object (mouseX(), MouseY(), 1,2)
PX#=Int(Get pick vector X())
PY#=Int(Get pick vector Y())
PZ#=Int(Get pick vector Z())
Print "X: ",wx#," Y: ", wy#," Z: ",wZ#, " Distance: ",H#
`object/road placement
If mouseclick()=1 and flag=0 and Road=road
obX#=wx#
obY#=WY#
obZ#=WZ#
If object exist (Road)
Road=road+1
flag=1
Make object plane Road,50,50,1
Flag=1
Color Object Road,RGB(255,200,0)
position object Road,Obx#,oby#,obz#+25
else
Make object plane Road,50,50,1
Flag=1
Color Object Road,RGB(255,200,0)
position object Road,Obx#,oby#,obz#+25
endif
endif
if flag=1
LOCK VERTEXDATA FOR LIMB Road,0
vc=GET VERTEXDATA VERTEX COUNT()
set cursor 10,25
Print VC
`road edges
`positioning
Set vertexdata position 2, wx#-obX#, Abs(WY#)-oby#,Wz#
Set vertexdata position 3, wx#-obX#, Abs(WY#)-oby#,Wz#
Set vertexdata position 1, wx#-obX#, Abs(WY#)-oby#+50,Wz#
unlock vertexdata
if mouseclick()=0 and flag=1
Color object Road,RGB(0,200,0)
unlock vertexdata
flag=0
endif
endif
loop
Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.