[Closed] virtual viewport
Hey,
I am trying to find out if anybody knows a way to access the virtual view port in max through max script…
I want to create a simple dialog that will have 3 sliders – zoom in, x, y.
I would like to link the parameters for that to my dialog,
Cheers,
Asa
Hi Asa, i have the same question with you…
so, i wil watch this thread
i want 3d viewport in a rollout floater, it’s like cartoon car rig that Yassine4D does.
can anyone tell me how to do that in MXS?
AsaMovshovitz: I don’t think there is access to the virtual viewport.
For the curious – the ‘virtual viewport’ is an option that becomes available when you use OpenGL (maybe it’s in Direct3D nowadays as well), where the viewport display becomes a sub-region of a full viewport. I’ve never used it, but it’s got its uses.
anggahenggara: Different question, actually – you just want to make something in a rollout that shows a viewport?
Unfortunately you can’t actually create your own full-on viewport (you could try, somewhat, but it’d be a lot of work) but you can use something like this to continually keep a viewport representation in a viewport:
-- function to set a bitmap control's bitmap to the currently active viewport image
-- does not retain aspect
fn setViewportBmp bmpControl = (
viewportDib = gw.getViewportDIB()
copy viewportDib bmpControl.bitmap
bmpControl.bitmap = bmpControl.bitmap
)
rollout test "test" (
bitmap bmp_viewport
on test open do (
bmp_viewport.bitmap = bitmap bmp_viewport.width bmp_viewport.height
)
)
createDialog test
callbacks.removeScripts id:#test
callbacks.addScript #viewportChange "setViewportBmp test.bmp_viewport" id:#test
Can fancy that up in all manner of ways.
wow it’s little bit approach to what i want, but i want able to select objects in rollout-viewport and able to rotate view in rollout.Is it possible?
Only with a lot of work, I’m afraid.
Basically you could start out with something like an imgTag, record mouse clicks in that, project that to normal viewport coordinates, create a ray based on that, run an intersectRay, and select the intersected geometry.
Like I said – a lot of work A full interactive viewport – like you have in the main max interface – can’t be added to your own dialogs.
I tried the code use max 8, but I get nothing in the virtual viewport , whats the matter?
ok, it work now
but still I have a question can display the animation in the virtual viewport just like in max viewport