Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
On 08/05/2014 at 10:19, xxxxxxxx wrote:
Hi! As title... for views Top...
cam_pos = bd.GetSceneCamera(doc).GetAbsPos()
is not recognized....
cursorpos = bd.SW(c4d.Vector(mx,my,500)) collider = c4d.utils.GeRayCollider() collider.Init(mypoly) length = 500000 direction = -(cam_pos - cursorpos).GetNormalized() did_intersect = collider.Intersect(cam_pos, direction, length) if did_intersect: position = collider.GetNearestIntersection()["hitpos"] else: position = cursorpos doc.AddUndo(c4d.UNDOTYPE_CHANGE, myobject) myobject.SetAbsPos(position)
cursorpos = bd.SW(c4d.Vector(mx,my,500))
collider = c4d.utils.GeRayCollider() collider.Init(mypoly) length = 500000 direction = -(cam_pos - cursorpos).GetNormalized() did_intersect = collider.Intersect(cam_pos, direction, length)
if did_intersect: position = collider.GetNearestIntersection()["hitpos"]
else: position = cursorpos
doc.AddUndo(c4d.UNDOTYPE_CHANGE, myobject) myobject.SetAbsPos(position)
where I am wrong?
On 08/05/2014 at 12:19, xxxxxxxx wrote:
Hi,
It works... But be aware if you change to e.g. Top view, your
is c4d.Vector(0,0,0)
Martin