All 3D UI

I’ve been getting up to speed with the UnityGUI for our project, and going over it with some of the art staff here (showing them the GUIX Designer and such as well, since it’s a time saver).

One of the big questions that the artists are asking is “how hard it would be” to have a fully 3D UI? By that, they mean having different screens (like the inventory panel, friends lists, minimap, etc.) be 3D objects in the world that can fly in from somewhere and show up in front of the camera, have UI typical buttons and text and labels and controls on them, have a kind of light idle motion on them all the time ( to look lively ), and can do animations in 3D (for example, a diary book that opens up, flips to a certain page, and then zooms up to the screen to show UI elements that can be manipulated).

I’ve only gotten familiar so far with the UnityGUI and GUIX Designer, and am trying to wrap my brain around how hard it would be to implement these types of features in Unity. I know that the GUI.matrix can be manipulated during OnGUI() calls, such that I could have 3D rotation and translation. Has anyone created 3D objects that acted as their entire UI system in Unity? Was it successful?

I know that there’s GUIText and GUITexture, not sure how applicable they are to this.

From my current perspective, it seems like an awful lot of additional work beyond the UnityGUI facilities, but perhaps not.

Thanks.

UnityGUI won’t really be appropriate for that, nor will GUIText/GUITextures. What you’ll have to do is fake buttons and behaviors on your own using textures and whatnot. For basic UI controls it shouldn’t be all that difficult, for more complex ones it may get tougher of course. I’m sure someone has done it already and perhaps they can speak up, anyone? :slight_smile:

Well, you CAN modify the Matrix that UnityGUI uses to render, which could be used to create 3D-like effects if you have someone who knows what they’re doing with graphics matrices.

We have tried this before, and while you can apply a projection matrix to the GUI matrix to make the GUI look 3D-ish, it still is not good enough for production. Plus you have the click rects to deal with and so on.

What you could look at (with Unity Pro) is generating meshes for all your elements, and then drawing them with the Graphics class. You could draw them within GL calls also, but you will likely get better mileage out of the Graphics class.

If you are only planning on displaying a small handful of elements, then you could just use standard meshes placed on GameObjects in your scene, with custom mouse and state handling scripts attached.

Keep in mind that at this point you are building a custom GUI system from scratch, and for things like text input and dynamic text display, you will likely want to just use the standard GUI classes.

-Jeremy

Nod. Thanks for the responses and clarification.

So it’s doable, but certain not with the ease of implementation that UnityGUI/GUIX would provide.

Sounds like I could pull off some simple effects with the gui matrix, but not like creating 3D UI Panels with depth (like rectangular blocks that had buttons on them). For that, I’d need to build my own ability to have UI looking textures and logic to handle them. Making a listbox on a 3D object doesn’t sound like much fun.

I’ll probably suggest we do a simple, direct UI approach initially, and then see how far we can make it look “3d-ier” later on.

Thanks again for the response. Slowly getting up to speed, and appreciating the help I’ve gotten on the forums.

Not sure if this is the kind of thing you were talking about, but try this little application out:

http://thomasbaron.concretecellar.ca/3dgui.php

click the box to open the menu.

This took me about an hour for everything.

It’s not pretty or anything, but the concept is there. For this I didn’t use any GUI elements of unity, mostly just the onmouse functions. I’m sure something like a textfield could be made without spending too much time, although i’d have to scrounge through the docs to figure it out at this point.

Hey there. Thanks for the demo link. Nice work! It looks like I could do what they’re asking, then, with enough time. I’m pretty sure I’d have to invest a decent amount of time mimicking a lot of functionality (listboxes, radio buttons, drag and drop inventory panels, etc.). Not sure if they’d allow enough time for that.

Still, thanks for showing me that. Slick.

The link seems to be down, can you repost it?

Thanks

okay, fixed the link

hey TJB

that looks awesome

i am after something basic like that for my game

basically a cube that can spin only in one axis with each of the faces being a menu item

like

start game
high scores
help
quit

can you help me with the code please

@ahloyan: Please don’t post your exact same question in multiple locations without at least cross-referencing them. It’s potentially bad as it may cause two discussions on the same topic in different locations, possibly unnecessarily using some people’s time through duplication of effort.

For reference, ahloyan posted his same question in this other thread.

Another option (Pro only) is to have actual 3D objects in a layer not visible on the main camera, rendered via another camera to a render texture. This texture could then be displayed in the GUI.

While this is fairly straight forward for non-interactive GUI, it’ll take a bit more code to reinterpret the mouse position and apply that to the 3D objects, but it should be completely doable.