PDA

View Full Version : virtual viewport


AsaMovshovitz
12-03-2008, 05:14 PM
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

anggahenggara
12-04-2008, 10:44 AM
Hi Asa, i have the same question with you..
so, i wil watch this thread

Mixx
12-04-2008, 11:19 AM
misunderstood the OP, moving on :)

anggahenggara
12-04-2008, 11:39 AM
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?

ZeBoxx2
12-04-2008, 11:53 AM
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.

anggahenggara
12-04-2008, 12:32 PM
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?

ZeBoxx2
12-04-2008, 01:39 PM
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.

anggahenggara
12-05-2008, 06:48 PM
thanks ZeBoxx for helping me.

flyingaway
03-22-2009, 06:10 AM
I tried the code use max 8, but I get nothing in the virtual viewport , whats the matter?

flyingaway
03-22-2009, 06:19 AM
ok, it work now
but still I have a question can display the animation in the virtual viewport just like in max viewport

gfx3d
03-22-2009, 07:17 AM
nicely said ZeBoxx2 (http://forums.cgsociety.org/member.php?u=235423) .thanks you

CGTalk Moderation
03-22-2009, 07:17 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.