[Closed] constant size
Is there posibility to make a script – “3d mesh helper”
where a mesh keep constant size when viewport zoom is changing ?
(
sp = sphere radius:10
fn createCallback =
(
if not isValidNode sp do return false
local zoom_factor = getScreenScaleFactor sp.pos
format "zoom factor:%
" zoom_factor
--How to calculate Sphere size
--to remain with same size during zooming?
)
)
registerRedrawViewsCallback createCallback
unRegisterRedrawViewsCallback createCallback
Almost done, but need some adjustments
Any help will be appreciated :wavey:
(
struct ZOOM_DATA (obj, dist1, dist2)
ZD = ZOOM_DATA()
ZD.obj = sphere radius:10
ZD.dist1 = getScreenScaleFactor ZD.obj.pos
ZD.dist2 = ZD.dist1
fn createCallback =
(
if not isValidNode ZD.obj do return false
ZD.dist2 = getScreenScaleFactor ZD.obj.pos
local zoom_percent = ZD.dist2 / ZD.dist1
format "dist1:% dist2:% zoom percent:%
" ZD.dist1 ZD.dist2 zoom_percent
ZD.obj.radius *= zoom_percent
ZD.dist1 = ZD.dist2
)
)
registerRedrawViewsCallback createCallback
unRegisterRedrawViewsCallback createCallback
What would this be used for, out of curiosity?
You still with 2K Czech by the way? Mafia 2 was pretty sweet, but I wish so much of the story wasn’t cut Someones making multi-player for it though, so I’m excited for that.
Hi
I’m not in 2K company anymore , so I can’t tell you how is going there…
Now I’m in Vatra company and we’re working on Silent Hill.
The script that I’m do ,should be for manipulating objects (size, rotation, etc…), like in pic…
by the way…you have a nice portfolio Matthew
Thanks for the compliment
Thank you for posting the FlowLayoutPanel code a long time ago. I’ve used that for many different projects now
much easier is to draw the balls per pixel than keep the constant size in any view…
Hi Denis
Good idea, but how to do it? I’m not much familiar with simple manipulators.
For now here is an example with spline shapes:
And Here Is the code (not finished yet):
Objects Transformer
http://mithrillgate.wgz.cz/3dsmax-skripty
(scrip is updated now , missing fn)
what do you think about this way ?