Mesh-based 3D GUI

Blitz3D Forums/Blitz3D Programming/Mesh-based 3D GUI

Techlord(Posted 2005) [#1]
I've seen some really good Mesh-Based GUIs (Polygon Mesh, Not Sprites) in some really cool games lately, but, I have yet to see a Mesh-Based GUI Library. I have some old GUI code I was considering revamping into a Mesh-Based GUI System.

The system would provide a simple 3D Font, MeshSprite Animation/Orientation/FX/Texture Control, and Event Handling. IMHO, this would be a unique GUI Lib for Blitz Community.

Whats your thoughts.


Ross C(Posted 2005) [#2]
Would that be a single surface GUI? I thought they was already one or two out. Sswift not have one? hmmm :o) I don't recall.


John Blackledge(Posted 2005) [#3]
Yes, this would be a good idea, Frank.
Please feel free to use my code in the 'Image System' thread as a basis for the the mesh surface, if you don't have one already.


Techlord(Posted 2005) [#4]
Ross C,

I'm refering to complex Meshes > 2 polygons, not Sprites. I'm not sure if you achieve the desired texture control with a single surface system, but, I wont rule it out.

Thanks John, for the contribution . Very well organized too. I like it alot.

Checkout Johns HUD Code Here:



Rook Zimbabwe(Posted 2005) [#5]
Oh yes I see a spark of smarts there! Great work!!!!!!!! :)
I may dig out the rhino and make a mesh or two to see how this would work with a more complex mesh. I added TURNENTITY 0,1,0 : Delay 10 (and the negative) attached to right and left arrows respectivly... works good.

Decided to stop counting the days left in the rack... got to go see Big B next week. Signal Corps - Pro Patrias Vertias!!!! OoooooAhhh!!!

-RZ


nawi(Posted 2005) [#6]
Heres my uncompleted GUI.. its open source take a look if you want, comes with gui and an example

http://personal.inet.fi/peli/panusoft/nawi/gui.zip


Damien Sturdy(Posted 2005) [#7]

I have yet to see a Mesh-Based GUI Library



My current UI supports meshes of any size, though its very incomplete. I also dont know what im going to be doing with it otherwise i would have a nice lil demo up now :)

(would love to give it free, but hey, i'm short of cash and i have a nice project that might work well with it now....)


Techlord(Posted 2005) [#8]
nawi,

Thats looking good.


AdrianT(Posted 2005) [#9]
we used 3dsmax for market value, WYSIWYG fashion, via B3D piipeline, but we did have to code all the actions for the animated children etc and rollover functions. Worked pretty well and were doing the same in the racing game were currently working on.

A bit like creating a web pageonly the graphics side is easier than dreamweaver.




Techlord(Posted 2005) [#10]
Guys,

What I am to do is a 3DUI that uses meshes > 2 triangles. No quads or Sprites.


The system would provide a simple 3D Font, MeshSprite Animation/Orientation/FX/Texture Control, and Event Handling.

Just imagine, your game starting up with a pitch black screen. Vrrrrmmmmm, START - OPTIONS - EXIT meshes warp from the depths of 3D Space into your face. The meshes gyrate slowy until you move the 3D Pointer over them one at a time. Upon moving the pointer over (PointerOver) each mesh, it fades from a dark color to bright one then pulsates (shrinking/growing) until you click on it (PointerClick). When the selection is made, a Robotic Voice sample announces: "Intruder Alert!" and each Mesh fades out one at the time until the screen returns to pitch black. "Loading...."


Conan(Posted 2005) [#11]
Good Idea, frankie!!
Might have something in there, though i'd think you'd have your hands full with al da comunity projects... where do you get the time?


Techlord(Posted 2005) [#12]
Conan,

I have some old code hanging around. I aint doing nothin fancy. For all intense purposes, this type of UI is extremely easy to devise compared to a 2D windows-style gui. Loading meshes and 'Picking' them with a mouse is relatively child's play with Blitz.

No fancy treeview, list boxes, combobox etc. If one needs those controls they will most like not use this library for it.

The highlight of the system will be the Animation Control. In which a Animation 'script' and Audio can be assigned to the following Events: MenuOpen, MenuClose, MenuSwitch, PointerOver, PointerOut, PointerClick.

I have not started to code anything. Mainly looking for input.

where do you get the time?
Between my job and house arrest, I'm literally on a PC ~18 hrs a day...hehe. Most of my focus has been towards BlitzScript3D, which is being used into Project PLASMA FPS and PersistentWorld3D.


John Blackledge(Posted 2005) [#13]
"Oh yes I see a spark of smarts there!"
No way. I just tidied other peoples' code and simplified it, but thanks anyway.


Techlord(Posted 2005) [#14]
Heres my working paper for Model Animated User Interface (MAUI). MAUI is a unique GUI Library that relies on the use of models for GUI controls instead of Sprites.

Scene

A scene is a specified area in 3D Space in which MAUI Controls are displayed.

A Scene contains all the information needed to control the camera & pointer, animate meshes, detect events and execute actions.

Create a scene location point, add a camera, add a pointer (optional), and Add Meshes. Assign meshes Animation and Sound based on Scene and Pointer Events.

MAUI Supports B3D, 3DS, X, and MD2

When a Scene is 'Opened', camera control, double buffering, keyboard and mouse input are passed to the MAUI_Scene Controller. Background snapshot can be taken to be rendered to provide a Backdrop. A limited number of effects will provided
for the backdrop.

Animation

An animation is modification to the mesh over a specific number of frames.

Their are two types of Animation Effects: Translation and FX

FX: Color, Alpha, Texture, Shinniness, EntityFX
Translation: Position, Rotation, Scale, KeyFrames, Mesh Deformation

Complex Movements are achieved with B-Splines, Triggers, and Triggers as Waypoints.

Triggers can be used to activate animation at specific frame.

Summary of MAUI Objects based on this working paper:

MAUI_Scene
MAUI_Backdrop
MAUI_Camera
MAUI_Light
MAUI_Pointer
MAUI_Gadget
MAUI_Font
MAUI_Sound
MAUI_Animate
MAUI_Effect
MAUI_Spline
MAUI_Trigger


Bot Builder(Posted 2005) [#15]
yikes. Another project plan eh? :/ maybe finish one sometime? eh...

A windows style 3d gui would be pretty cool if it was actually 3d. Like, on/off buttons (not checkboxes) would shine red and green light obstructed by buttons, sliders, etc.... there would be a global light pointed slightly down/right so that menus, etc cast a shadow.. mmm. cool but pointless


Techlord(Posted 2005) [#16]
yikes. Another project plan eh? :/ maybe finish one sometime? eh...
Answer: I have some old code hanging around. I aint doing nothin fancy...I have not started to code anything. Mainly looking for input.


A windows style 3d gui would be pretty cool if it was actually 3d.
It would be intersting to navigate a TreeView in 3D.


Rook Zimbabwe(Posted 2005) [#17]
Frank I can almost see that... I am picturing the scene from Jurassic Park where the female squirt is trying to open security from UNIX. Does anyone else remember that? OK I can't forget most of what I see and have a horrible memory for incredibly useless trivia but still...

The server was a giant circle and the folders were little boxes with sprite type labels... There were lines representing connections to other servers or the net.

Kind of a 2D / 3D isometric thingee.

Hows that for a technical description!

-RZ


Techlord(Posted 2005) [#18]
Rook

I can see that. But, with a large directory things could get interesting. Application, Game or not, it could be fun to navigate your harddrive in 3D.


Techlord(Posted 2005) [#19]
I was sitting here at work, thinking to myself: "Why 2D Windows Style GUI Libs are so complex?" When you think about it there are basically four controls: A form, viewport, button, boundbox. For example, you have a standard button and toggle button. Both are buttons, but, the Event Behavior is different.

Click on a standard button with the pointer and it goes down, release the click and goes back up. Click on a toggle button and it goes down, release the click and it stays down. Click on it again, and release the click and goes up.

Checkboxes and Optionboxes are buttons too. The are group to together within a Boundbox or Form. Both behave like toggle buttons, the Event Behavior is slightly modified so that checkboxes can be checked individually with no effect on another, meanwhile option boxes undo the checked state of their 'siblings' in the group.

A Slider is a button too. Its event behavior is too move upon clicking within defined by a boundbox. The movement is calculated and adjusts a value based limits of the value, boundbox dimensions, and the sliders dimensions.

Viewports create display areas on forms. There job is to grab the image of the other controls and clipped within its dimensions.

This leads me to this. Why hasn't a 2D GUI Lib been developed based on these Four Controls. A GUI Lib that allows you to easily create these controls, define their event properties {behavior, display, sound, and action}, and combine them (parent-child or sibling relationship) to create more complex controls like dropboxes, listboxes etc.

Anyhows, just blabbing here at work because they stripped the PC's down and removed my Blitz3D:(


Damien Sturdy(Posted 2005) [#20]
Sounds good and in fact its something i realised when doing my 3d stuff. Radiobutton is quite simply the same code as a normal button but with a "togglemode" value different and a bit of code to allow it to toggle. I can "togglemode 1" anything.

my sliders will be just a line drawn to a texture and a button that simply only moves on one axis.


Weve been having some similar thoughts, it seems!

your idea is interesting, a VisualUI system realy... wysiwyg and add sounds and events.

That gives me an idea; You could incorporate your script engine into the 3d GUI and script the controls.. thats one more product you got ^.^


Techlord(Posted 2005) [#21]
That gives me an idea; You could incorporate your script engine into the 3d GUI and script the controls
I've have considered this. BlitzScript3D is being employed in PW3D and with some very good results. I'm certain that it will be useful in other projects.

Weve been having some similar thoughts, it seems!
True. This is a very good sign for me. As I've been told that my ideas and concepts were far fetched or too complex. This is a very good sign for me.


flying willy(Posted 2005) [#22]
B+ treats nearly everything as a gadget - even windows.


Bot Builder(Posted 2005) [#23]
willy - yeah, same with almost every other gui lib on the planet XD

Your idea is actually rather elegant. It would work fairly well to make a master gadget abstract type/class. Then, have abstract form, viewport, text, boundbox, and button types/classes that inherit from gadget. Finally, classes inherit from these that give you specific controls like buttons, checkboxes, indicators, scroll bars, etc, etc. Some more complex controls can inherit from gadget itself, and include references to say, a few boundboxes, some buttons, etc.

More ideas for gui libs would include autopositioning and autosizing, which is especially handy for cross platform gui libs that use native gui. Makes custom gui easier to use as well, though. There are different schemes for this. Perhaps have definitions of pixel borders around specific controls, or elements inside controls. For instance, you could have a "Autoposition" control that positions all controls that are members of it so that they have a set amount of borders between them. For instance, have a horizontal autoposition control across the top which has 2 vertical autoposition controls as members of it. All the horizontal one knows is that one comes before the other. The code would figure out the maximum width of each control inside each vertical positioner, and figure out the x positions for them. Then, the vertical positioners will figure out there children's control's height and position them all spaced out with proper borders. Then, size of the whole structure can be returned, so that other controls may be placed around it. This idea is very extensible and a nice way to line everything up. Especially cool is using it in conjunction with autosizing, which sizes controls based on their content. This works with alot but not all controls. You can also have the form itslef autoresize to accomadate controls.

GUI tech certainly hasnt been totally explored.


Techlord(Posted 2005) [#24]
GUI tech certainly hasnt been totally explored.
I totally agree.

Well I'm back here at work with no Blitz3D to play with on my breaks. I reckon I could continue to expand my 'Working Paper' on MAUI: Model Animated User Interface.

A GUI Lib is great an all, but, I'm only interested in Libraries that come with a Editing tool. That would go for MAUI too. An Editor would require a typical Windows-style GUI. So, if I was to pursue a dev'ing a 2D GUI I would work from 4 Control concept I described above.


Heres my Working Paper for MAUI2D (for lack of a better title) GUI Lib. MAUI2D controls will be a 2D image or 2D rendered to 3D sprite based library. I've attempted to break the Control down to its lowest denominators and build up from them.

Images, Bounds, and Portals

The GUI system is based on a rectangle areas defined by a start x,y screen coords and stop x,y screen coords. There are 3 types of rectangle areas: image -> boundbox -> portal.

We all know what the definition of a image is so lets look at the definitions for boundboxes and portal.

The boundbox is used to perform collision detection with a pointer device. Pointer Events is the detection of collision and input by the Pointer within a bounds during collision. Pointer Events: PointerOver, PointerClick#, PointerOut.

Some may wonder why I use the word Pointer instead of Mouse. Its a generic term for the screen pointer as it may controlled by a keyboard, mouse, or joystick.

The portal is a boundbox the performs collision detection with images and other boundboxes. Images and boundboxes within its area are clipped. Portals are very useful for displaying several images and performing several boundbox checks within a small area on screen. In 3D a camera entity is used to represent a portal. portals

Simple Gadgets

Gadgets are objects contain a boundbox, images, and other properties used to control, communicate between the user and application. Gadgets use images to display its state. In most cases the state of a gadget is controlled by its pointer event or another gadgets state.

There are 4 simple gadgets: PushBox, ViewBox, Boundbox, LabelBox, InputBox

Composite Gadgets

Composite Gadgets are assembled from simple gadgets. ComboBoxes, ListBoxes, DiaglogBoxes are all examples of a composite Box.

Methods

MAUI2D_Event() - Device Input, Position, and Collision
MAUI2D_Message() - Provides a means of assigning and accessing Gadget Properties
MAUI2D_Behavior() Action performed on control or related controls during an Event
MUAI2D_Action() - Action not performed on a control during an event
MUAI2D_Display - Display the control

to be continued



Uber Lieutenant(Posted 2005) [#25]
OK, for those of you who still have little idea what Frank is talking about, take a look at Metroid Prime or Republic Commando.



The HUD is comprised of 3D models with some sprites that don't look directly at the camera. The entire interface is on a seperate pivot from the player's pivot so (in a FPS game) the HUD can lag behind the player's pitch and yaw settings (it's slower to move than the player's mouselook) and basically give the impression that you're wearing a helmet that projects vital data onto the visor. That's what Frank wants, and in fact I've been trying to get one working but still no luck.


Kuron(Posted 2005) [#26]
Between my job and house arrest,
care to extrapolate on the "house arrest"?


Techlord(Posted 2005) [#27]
care to extrapolate on the "house arrest"?
I'm married ;)


Uber,

Yes thats correct, and to include other game screens and menus.


Damien Sturdy(Posted 2005) [#28]
Frank, as long as you have your idea, the technology, and willpower, there is no project that is too complex or far fetched.


THOSE are the projects that make breakthroughs and make big dough!


Techlord(Posted 2005) [#29]
Cygnus,

Thanks for the encouraging words. I'm totally committed to completing the projects Ive started with Blitz3D. This includes Project PLASMA FPS, even if I have to do it alone.

I have narrowed a the basic gui controls down to two components and image and boundbox -hehe.


Damien Sturdy(Posted 2005) [#30]
if it is to ensure a project completed i will join Plasma. Too many of my projects have died now and i WILL finish this next project. Enough playing. Start doing.

(got a design up earlier and im sure it will be loved. Speak t'yall tomorow- im off to bed before i go to work for a new job tomorow!)


Rook Zimbabwe(Posted 2005) [#31]
I remember reading, back in the dark days of computers when VP Gore hadn't invented the interent (:P) and so I had to dialon ARPAnet... Back when the 486 was a serious thing and the new DX model had ALL the bells and whistles... Back when DOS was a serious choice for an operating system and still at 5.1 version (or thereabouts!) I began to take seriously the idea of writing games for computers. Wolfenstein 3D helped that idea germinate but I digress...

I read a book by someone British anout programming GUI for you programs... He had written a shareware paint program and he showed how with lots of interesting source code etc.

But the reasin I pundit this here was what I remember about the way he described HOW he made his GUI. Seems he used the apple idea of a resource file. All the GUI stuff (images and whatnot) was contained in the resource file. That way you could change the appearance of the gui at a whim and call those tools to put when needed.

So my contibution to this discussion is a simple question... Long winded though the interduction might be...

Could you not create this 3D mesh GUI by using a resource file?

And... did anyone else read this book (I am sure I don't remember it quite right as it was about 20+ years ago that I last looked at it!)

-RZ


AdrianT(Posted 2005) [#32]
yeah that metroid thing can easily be done with b3d pipeline as it allows you to create a camera and lock your UI to the camera. biggest problem you will probably have is blitz limited alpha sorting.


Techlord(Posted 2005) [#33]
If it is to ensure a project completed i will join Plasma. Too many of my projects have died now and i WILL finish this next project. Enough playing. Start doing.
Well I would like to sit down, talk about it. What game objects and features should the FPS Engine support?

Very few wanted to discuss what was expected from the engine. They just want to hop in and start coding. As you can see that approach has not brought the engine to completion. Lets talk about it here.


Techlord(Posted 2005) [#34]
yeah that metroid thing can easily be done with b3d pipeline as it allows you to create a camera and lock your UI to the camera. biggest problem you will probably have is blitz limited alpha sorting.
What is Alpha Sorting? Why is it needed?


John Blackledge(Posted 2005) [#35]
Just agreeing with Rook Zimbabwe, this is a portion of an INI file which defines my UI for one of my screen (exit screen).
(Not quite a resource file, but better than hard-coding.)

[PAGEQUIT]
1= panel, plinth,, ,, 300,240,500,360,
2= mess, text,FNTSTDM, ,, 310,290,490,310, Do you want to exit?
3= yes, button,, QUIT,yes, 340,330,390,350, Yes
4= no, button,, GotoPage,PageBrMenu, 410,330,460,350, No

This way I can alt-tab, change a value, alt-tab back, press an F-key which reloads the UI parameters, and I can immediately see the change.

Not as elegant as a dialog with choices, but practical.

For anyone who isn't sure how to store UI params, I'd recommend using INI-files.

You can always write a front-end for that system later.


Techlord(Posted 2005) [#36]
Guys,

I think I have broken a 2D GUI System down to its lowest possible denominators: Image, BoundBox, Pointer.


Chroma(Posted 2005) [#37]
I have a headache...


Uber Lieutenant(Posted 2005) [#38]
Looks like MAUI would be used for Project PLASMA. Looks like all of Frank's community projects revolve around it, in fact.


Techlord(Posted 2005) [#39]
Looks like MAUI would be used for Project PLASMA. Looks like all of Frank's community projects revolve around it, in fact.
Good Observation, but, actually all of my projects are based around my TournamentBlitz and a Cash Tournament FPS Game that uses my Gunvertor Weapon Concept.

Not all of my projects are 'Community Projects' most are just open development. In fact, I've only contributed to two Community Projects: Project PLASMA FPS and PersistentWorld3D. All others were open dev to get some new ideas flowing around.

I do try to work on projects that can be used for other game genres. For instance, BlitzScript3D can be used for pratically any game and application as many of these can benefit from a scripting language. PersistentWorld3D can be used to create Game Worlds or orientate Virtual and 3D objects for RTS, RPGS, and other games.

Even many components of the Project PLASMA FPS Game Engine could be use for other than First Person Shooter with a good Modular Design. LOD Management, Portal Rendering, Single-Surface Sprites and Mesh-Base Particles, 3D AStar Path Finding, FSM AI can be used in other types of games.

People just get hung up on Terminology. As soon as you mention FPS they can only visualize a Weapon attached to the lower right-hand side of the camera. They completely forget about all the other technologies that go into it that can be used for others genres.

When you think about it, its really only a matter of camera perspective.


Techlord(Posted 2005) [#40]
I ran into some performance trouble while running BlitzUI (2D GUI) and 3D together on a work PC. It has been mentioned that some video cards choke when running 2D and 3D. Due to this conflict, MAUI2D will have to be a 3D (sprite-based) system.

One approach would be to devise a set of functions that mimic Blitz3D's 2D Image command set. This would make the transition from 2D Libs to 3D less painfull. So the Image commands will simply have MAUI_ prefix (ie: LoadImage -> MAUI_LoadImage).


{cYan|de}(Posted 2005) [#41]
"What is Alpha Sorting? Why is it needed?"

oh dear lol


Techlord(Posted 2005) [#42]
oh dear lol

Not sure whats humorous about the question. Still no answer.


sswift(Posted 2005) [#43]
Frank:
Alpha sorting is sorting polygons which have transparency back to front so they draw in the right order.

If you don't sort them then you will get weird effects where one object obscures another even though it is really behind it.

If you didn't have zbuffering, you'd have to do this even with normal polygons. Zbuffering is disabled for transparent polygons though because zbuffering can only stop polygons fron being rendered, not fix the order they're drawn in. The visual glitches that would result would be even worse than the problem.


Techlord(Posted 2005) [#44]
Sswift thanks for the explanation. Its possible that I will have to deal with this in MAUI. Its a high level management problem because its totally based on how you apply transparency.

My approach to this situation is simple: alter the alpha levels dependent on what control has focus. Control in focus is more opaque than controls out of focus. Do you have other suggestions for dealing with this issue?


sswift(Posted 2005) [#45]
Making a control more opaque will not make it render in front of another. Nor will it really make it appear to be in front of another.

Also, keep in mind that I said polygons, not objects. Even the polygons within an object need to be sorted with one another. And it is not possible to sort the polygons between objects, or even sort polygons perfeclty if any of them intersect.

The best you can do is to sort the polygons within the individual objects with one another, and sort the objects.

Of course you might just leave sorting the polyogns within the object up to the user.

In my opinion, there is no best way to allow someone to add 3d objects to an interface. I didn't support that out of the box with my own GUI system because if someone wants to do something like Metroid Prime, in my opinion, the best way might be to maybe hack a gui system like mine to render to an image and then use that image on a model of a helmet which you place over the camera. The 3d buttons you see in the interface might as well be sprites that just look 3D.

Or the best way might be to create a single object with a single surface for the face of the helmet, and texture all the elements in that surface with bits of the main texture, and actually deform the shape of the object to fit the curve of the helmet.

It's not possible to cover all situations, and corvering lots of them might result in a lot of messy code. So I just kept things simple in my own system since I could not really predict what the user might want.

Oh and another thing you could do...

Another way to render an interface like that would be to do what my GUI system does and render the interface with a second camera... But in this case you'd set to FOV of that second camera to be wider to create the fish eye effect to make it LOOK like the helmet is curved. It might be hard to get that to look right though if you have a helmet you want to match up wuth the curved glass.


Techlord(Posted 2005) [#46]
I anticipate that I will have to sort them manually and provide sortof visual indicator of what control has focus wether its changing the alpha, color, orientation, or animation.

I agree that hacking may be the only way to produce a Metroid Prime-like interface. Just hope the library makes it easier.


Techlord(Posted 2005) [#47]
A majority of my ideas for a MAUI3D Dev Interface have evolved around MS Powerpoint, however, playing with MacroMedia Flash 6.0 is sparking up bigger, better ideas.

The Flash Interface provides an intuitive means to organize and animate 'symbols' on a TimeLine. It also features layers, which have become a 'almost required' feature for me to get anything of value accomplished.

I would really like to work on this, but, I'm not really excited about the MAUI2D GUI portion:(


Techlord(Posted 2005) [#48]
Its been six months since any work has been accomplished on PersistentWorld3D. The major hold up is a Free Full 3D GUI Lib. As much as I despise GUI programming, I feel that time has come start writing one myself.

I will be designing the GUI Lib using the 'working papers' i describe above. Looking for more ideas on types of gadgets.


Damien Sturdy(Posted 2005) [#49]
Strange you bought that up- I've started working on mine again recently because there was no other suited GUI for the project it's in.

I'm not really too sure as to what sort of gadgets- IN an FPS they can be anything really- One of the good things is that you could have a model of each weapon and click it to activate for instance.


Techlord(Posted 2005) [#50]
Cygnus,

I'm looking to develop a 2-in-1 gui system: Polygon Mesh GUI and traditional 2D Windows style using 3D Mesh Quads. A one stop shop solution once and for all.

Games tend to have heavily animated gui systems and can be combination of 2D panels and 3d models. I would predict the editor for 3d polygon mesh gui system would be similar to 3d scene animator in which you setup lights, cameras, and waypoints. The 2D editor would be similar to a powerpoint animation editor.

I would expect the 2D windows-styled gadgets would be of the typical design: form, menu button, command button, option button, checkbox button, label, frame, slider, spinner, textbox, listbox, combobox, treeview, and meters.

I'm more in favor of fewer controls with programmable event behavior so that new interesting controls such as knobs and gauges. Of course traditional behaviors will be provided.

Other Considerations

Single Surface Quads and Textures
Bitmap Fonts
Animated Bitmap Fonts
Plotting

Overall, there is lot to consider which is why I have not been all that motivated to program it.