Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Kuper
18
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 24th Feb 2015 20:20
Hi!
Maybe someone find plugin or good snippet for 3d interface? I mean the way to create windows and buttons on quads not by sprites( and not in Windows™ style).Like this:


Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 25th Feb 2015 12:07 Edited at: 25th Feb 2015 12:13
3D interface is only used when the UI elements rotate in the x or y axis, though you can simulate this with sprites, screwing them. The image you put up above (Gothic 3) is most likely made with sprites since it has no 3d elements, it's all flat.

But one thing to point out. You need to make a 2d interface for a 3d one to work. Basically the 3d interface just reference the 2d one which functions exactly like a 2d one, so if your going into 3d ones you need to know how 2d works first.

So my question is do you know about 2D interfaces? like how to make the image above with sprites or images? cause there isn't no plugins I know of but making one like this is relatively simple.

"Get in the Van!" - Van B
Kuper
18
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 25th Feb 2015 15:18
Yes i made some tests using sprites for interface.They works well especially with Advanced Sprites.Maybe I find not the best example.

Here is full 3d interfce which made with little quads.Its much simpler than
in Gothic but this way have some advantages
1) you do not have to scale interface for your screen size
2) it is much faster
3) you can add special shaders for interface

wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 25th Feb 2015 15:57
I'd think that would be a good use of the lock object on command, and then hide and unhide as necessary.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 25th Feb 2015 16:10 Edited at: 25th Feb 2015 16:20
Quote: "you do not have to scale interface for your screen size"

You don't have to do that with sprites.

Quote: "it is much faster"

Depending on what it's doing then yes.

Quote: "you can add special shaders for interface"

The best reason by far


Now it really depends on what your doing. Simply displaying a quad with a texture on it for the interface is easy. But when it comes to interacting with them, especially if any of those quads rotate in the x and y axis then things get a little tricky.

I would say the best method would be to make a orthogonal camera, and put quads in front of it and output the camera to render target and combine with the main camera (via shaders or whatever means). The main advantage of this is you don't have to deal with trying to lock things flat to the main camera at whatever angle it is (so you eliminate constant calculations to keep everything in place), everything is in screen space so finding the coordinate for interacting with the quads is simple (unless they are rotated xy) and lastly priority sorting is just position by depth which doesn't change the size of the quad (unlike lock object).

"Get in the Van!" - Van B
Kuper
18
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 25th Feb 2015 18:15
Quote: "You don't have to do that with sprites"

What do you mean?
If I create 128x128 size sprite and its looks good at my screen resolution 1920x1080 and then I turn to 800x600 resolution I have to scale sprite down(each sprite in the screen)

Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 25th Feb 2015 18:51
Scaling to fit different resolutions or resizeable UI elements is pure design choice is what I mean. Some games do it and some don't. Alot of games the UI doesn't really change size but it just reposition elements to fit the screen whatever size.

"Get in the Van!" - Van B
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 26th Feb 2015 03:03 Edited at: 26th Feb 2015 19:54
Anyway, playing around I figured out how to lock objects to the camera in screen spaces using lock object on, meaning 128x128 quad represents 128,128 pixels.

Simple Function:


Example:


Now all you'd need to do is texture them, apply shaders and handle them exactly like you would 2d and boom, 3d interface. For Z sorting, I guess you could just offset the Z axis by a tiny tiny bit. If offset it too much it will become smaller or bigger cause it's distance to the camera would change. But if it's by .01 or something then you won't notice it I guess

"Get in the Van!" - Van B

Login to post a reply

Server time is: 2026-07-11 18:26:07
Your offset time is: 2026-07-11 18:26:07