Page 1 of 1

Viewport command in vb.net

Posted: Tue Dec 27, 2005 2:59 am
by DGENXP
Hi i am looking for help on VB.net to create a viewport does anyone have a code idea that might help me as i have no clue as to how to use it :cry: so it would be appreciated
8)

Posted: Tue Dec 27, 2005 7:43 am
by Andre Odendaal
Can you be a little bit more specific about what you want to do?

Posted: Tue Dec 27, 2005 12:45 pm
by DGENXP
:D Sorry mate

I am working on a 3d Rpg making program i need to know how to use the viewports command to create 4 viewports with different camera angles top,front,side and perspective and as you can tell from the previous post on this forum i am a complete n00b at this iirrlicht SDK, all i need to know is how to use the command basically how do i DIM a viewport i can then do the rest

this is the command that i am haveing trouble with
'-----------------------------------------------------------
device.VideoDriver.ViewPort(New Rect(0, 0, x/2, y/2))
'-----------------------------------------------------------

I hope this has helped me to be more specific

Posted: Tue Dec 27, 2005 2:10 pm
by Guest
OK, with you now. This is what you want

'------
device.VideoDriver.ViewPort = new Rect(0, 0, x/2, y/2)
'------

ViewPort is a public property not a method

Posted: Tue Dec 27, 2005 2:12 pm
by AndreOdendaal
Darn! I always forget to login before I post!

Posted: Tue Dec 27, 2005 3:14 pm
by DGENXP
:) thanks mate that worked a treat

one more question how would i define more than 1 of these viewports if it is possible?

woud i need to create a new device for each viewport?

or is there an easier way to do this

Ok I have tried to create another new device but it crashes, could i possibly need to create an array?

if you can help or at least steer me in the right direction i would very much appreciate it

Posted: Wed Dec 28, 2005 5:59 am
by AndreOdendaal
You can only have one viewport set at a time. So unless you want to have 4 different windows looking at a scene (I'm not sure how you'd do that, I'll have to play around) you simply have 4 rects and apply the right when when the user selects the view.

another way

Posted: Mon Jan 09, 2006 12:28 am
by Brett19
Its also possible that you could use render to texture, have 4 textures on screen and have the actual 3d hidden offscreen with the textures rendering from different angles.