ui xith3d

[quote]I’ve a problem with the Foreground:
I’m rendering my UI to a single textured Quad (i put this into a util class ImageOverlay). My SG looks like: VU-BG-Foreground-BG-Shape3D-Quad-Texture. The screen stays black???
Ok because i’m in a hurry with this UI, i temporarly used the UiWindowManager - this means my ImageOverlay implements UiOverlayInterface and returns the Shape3D in the getRoot() and it works (Canvas3D-UIWinMan-Shape3D-Quad-Texture).

What’s wrong? Why is UiWindowManager working and Foreground not? Do i need to add any transformations? Or use a different version of Xith3D - i use 2004-09-18?
[/quote]
Try the latest from CVS - Foreground is very new.

I am sure it is working, I use it extensivly.

Where is your quad positioned? Chances are it is just off camera. Assuming you are using VIEW_FIXED - make sure your depth (z) is negative. That will place it in front of the camera. Also make sure it isn’t getting clipped by any near clipping.

Clearly I need to write a small tute about Foreground.

Will.

[quote]3AM in the morning!!! I hope your in a different time zone and not at work…youch.
[/quote]
Hehe, no I live in Brisbane Australia so it was in the afternoon for me :slight_smile: Since getting a full time job, 3am coding sessions are rather rare :wink:

Can you simply have a pow2 texture bigger than needed which you just cut off the bits you don’t need?

Can’t help you with picking but Foreground does honour alpha transparency.

I agree.

Will.

Thanx Will :slight_smile:
The UI is now really fast - i do Raster-Updates and only for the dirty regions - it outperforms Java3d many times - i thought a BufferedImage-UI is not possible, but it seems to work. 8)

[quote]3AM in the morning!!! I hope your in a different time zone and not at work…youch.
[/quote]
Here it’s now 2:56AM - but four minutes are short :wink:

[quote]o Even a simple UI should have
- some kind of progress bar (power, life, bullets etc.
- dynamic areas (efficiently updatable) for dialogd etc.
[/quote]
ok, i’ll add a ProgressBar, and dynamic areas are currently possible…

Good night…

[quote]Thanx Will :slight_smile:
The UI is now really fast - i do Raster-Updates and only for the dirty regions - it outperforms Java3d many times - i thought a BufferedImage-UI is not possible, but it seems to work. 8)
[/quote]
You’re welcome.

I can’t wait to see your work. Do you have a screen shot? Just how fast does it update?

Sounds like this might be just what we need.

Will.

I just implemented it as well and Im looking forward to seeing some cool widgets for it ! :slight_smile:

I ran my own experiments, and found that a full-screen 800x600 texture (blown up to 1024x1024 internally) suffered from sufficient “UV float fuzziness” that it was only about 80% pixel accurate. The closer the base image got to 1024x1024, the closer to pixel-accurate it became.

In other words, there was enough UV float fuzziness that texture pixels were not being rended, because their neighboring pixels were often chosen to be rendered instead, making it look like the drawn image was a poor copy-of-a-copy type image.

My GUI system currently uses a tiled texture process, where each texture tile is exactly a power of 2, and its base polygon is sized to match exactly a 1:1 screen pixel size. It works perfectly and is pixel-accurate, using tiles that are 64 or 128 square. I haven’t yet decided if I’m going to use the tiled textures for each GUI window, or just a single full-screen collection to draw the entire GUI system on a single surface.

The trick is that the texture must be a power of 2 so UV is texel accurate, and the base polygon must be 1:1 screen pixel sized, so it’s screen pixel accurate as well.

Do you draw the textures on Quads? What Z depth are you using?

Will.

Yeah, each tile has it’s own quad, and the depth is 0.6f. I’m using the Maze3D code, with has a near clip of 0.5f, any I found that the avatar collider they used tends to keep the world 3D objects at least 0.7f from the camera. So I get a 0.5 to 0.7 range to put a GUI that won’t be clipped by the near plane, nor have world geometry cutting into it.

I’m also experimenting with making a GUI entirely of 3D objects (ie, colored quads and text stacked on each other, instead of a tiled texture plate with the GUI painted onto it). It’s really going to boil down to how many 3D objects can be handled per frame, versus how much texture region gets invalidated and must be reuploaded per frame…

Hi again! I was on a trip and needed to relax - sorry for waiting, but here we go…

(text above images)
Transparent windows, which can be moved around and resized (title changes) - the ported Swing-Layoutmanagers are responsible for sizing and positioning of the controls - the windows are sized by the layoutmanager of the top-container…

  • you can see buttons and textfields
  • they are painted using Graphics2D, so easy to extend with other controls - as i need i will add more

http://user.cs.tu-berlin.de/~clain/stuff/ss1.jpg

Here you can see the fire through the window :slight_smile:

http://user.cs.tu-berlin.de/~clain/stuff/ss2.jpg

The mouse-over and button-down effect - using borders

http://user.cs.tu-berlin.de/~clain/stuff/ss3.jpg

It is far from perfect, but a starting point for my project…
If somebody is intrested send me a message… currently it is not easy to extract, because it uses a AWT-indenpendent eventhandling and some extensionpoint-stuff, but after 4.11. i will have more time to improve…

ciao,
hasait

P.S. sorry for taking so much space - is there any way to reduce display-size of pictures?

this is looking very nice dude-

Yeah, this does look good.

I can’t wait so see some of these projects go public. Please feel free to host it in (and/or use the CVS of) the Java.net xith-tk project.

Will.

I would be very interested in some source code examples…I currently am using the xith UI but would like an alternative.

Hi all!

Thanx for feedback…
as promised - it’s now after the 2004-11-04 and i have a little more time and will take that time to extract the code and publish it… may be tomorrow

Hmm, not tomorrow, but it’s the usual software-delay…

Ok, here we go - i uploaded the stuff to
(the source + bin: <1MB) http://user.cs.tu-berlin.de/~clain/stuff/xith3d-ui-nolib.zip
(the libs: 9MB) http://user.cs.tu-berlin.de/~clain/stuff/xith3d-ui-lib.zip

Have fun with it :slight_smile:
It contains many application core-stuff - may be useful for you, too…
The event-handling is a little bit heavy and designed for non-game use (e.g. CAVEs, Medical Environments) - may be replacing makes sense…

Currently i’m redesigning/experimenting the whole stuff to be 3D-Components (XComponent, XContainer :wink: - so you can for example rotate your controls or mix it with other Scenegraph-Nodes (e.g. Shape3D) within a LayoutGroup, which contains a LayoutManager to arrange its children. (Yes, BoxLayout or BorderLayout in 3D!).
But currently i have some problems with:

  • clipping (how to clip e.g. a Shape3D - ClippingBounds?!?)
  • intersecting (the mouseover should react if the mousepointer is within the bounds, but a boundingsphere is a bad choice for a button)

If these are solved it should be quite useful…

bye and goodnight (it’s 06:00 - puuh)

We too are working on a GUI system for our application. What we’ve done is made a hierarchy of Shape3D’s, under a FG node with a scaling matrix that translates 3D FG coords into the exact matching 2D screen pixels, and vice versa. The different widget flavors (Buttons, Text, etc) are responsive to our application’s custom event notification of cursor positioning, but naturally that’s assuming the widget is flat-on to the camera, etc.

We had a real problem with the Text and clipping. We determined that due to UV floating, the only way a Text texture map would render correctly was if the texture AND the Shape3D was a power-of-2 size. However, that left a dilemma about how to clip the text when the window itself wasn’t a power-of-2 sized. We ended up discovering the Graphics2D.setClip() function… now we create power-of-2 sized textures and quads, but call Graphics2D.setClip() with the actual window size, such that the text drawn onto the texture doesn’t go outside of the bounds of the actual window. The rest of the texture is filled in with a 100% transparent color, and nobody ever knows…

http://jeramiehicks.no-ip.com/ConsoleImg.gif

The System window can be moved and resized correctly. The buttons work correctly. The Text windows can be dynamically modified during runtime, and they can be resized correctly. The red box indicates the actual size of the Shape3D and texture on the bottom window, although the drawing of the text onto the texture is clipped to within the widget boundary. If the text widget is resized to the point of needing a different power-of-2 size, it automatically recreates the texture/quad.

The hierarchy for this example looks like this. Note that “quads” are Shape3Ds, while “widgets” are our own custom objects that extend BranchGroup (thereby containing quads or more widgets):

System widget

  • Background quad (purple)
  • Title quad (light blue)
  • Menu button widget
    — Button image quad
  • Maximize button widget
    — Button image quad
  • Minimize button widget
    — Button image quad
  • Close button widget
    — Button image quad
  • Title text widget
    — Text quad
  • Content widget
    — Background quad (grey)
    — Chat buffer text widget
    ------ Text quad
    — Chat input text widget
    ------ Text quad

Note that isn’t a Swing window. It’s a stack of Shape3Ds that’s simply designed to look like one.

We don’t use layout managers at all. We define the top, bottom, left, and right of each widget as being measured from the parent top/left, parent bottom/right, as a distance from the parent middle (vertical or horizonal), or as a position/size combo. It makes for a radically cleaner and more predictable design, avoids the headache of layout manager implementation and usage, and does everything we need to do.

thanx…time to research this… ::slight_smile:

KABLAM…any thoughts??

nit GL is net.java.games.jogl.impl.windows.WindowsGLImpl
OpenGL Renderer = GeForce2 MX/AGP/SSE
OpenGL Version = 1.4.1
OpenGL Vendor = NVIDIA Corporation
OpenGL Extensions = GL_ARB_imaging GL_ARB_multitexture GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_transpose_matrix GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_window_pos GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_compiled_vertex_array GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_packed_pixels GL_EXT_paletted_texture GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shared_texture_palette GL_EXT_stencil_wrap GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_object GL_EXT_vertex_array GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_fence GL_NV_fog_distance GL_NV_light_max_exponent GL_NV_packed_depth_stencil GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_register_combiners GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NVX_ycrcb GL_SGIS_generate_mipmap GL_SGIS_multitexture GL_SGIS_texture_lod GL_SUN_slice_accum GL_WIN_swap_hint WGL_EXT_swap_control
No Fragment Program support, skipping
0 core.util.MethodCallMulticaster - ignored (main ERROR)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at core.util.MethodCallMulticaster$DirectInvocationHandler.invoke(MethodCallMulticaster.java:122)
at $Proxy1.preRender(Unknown Source)
at core.view.xith3d.component.Xith3dUserInterface.preRender(Xith3dUserInterface.java:194)
at core.view.xith3d.component.Xith3dUserInterface.update(Xith3dUserInterface.java:187)
at core.thread.updater.Updater.update(Updater.java:132)
at test.xith3d.TestXith3D.main(TestXith3D.java:115)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
at sun.awt.image.ByteInterleavedRaster.getDataElements(Unknown Source)
at sun.java2d.loops.OpaqueCopyAnyToArgb.Blit(Unknown Source)
at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)
at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)
at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)
at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)
at sun.java2d.pipe.DrawImage.renderSurfaceData(Unknown Source)
at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)
at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
at core.view.ui.VHUserInterface.paint(VHUserInterface.java:111)
at core.view.ui.VHControl.paint(VHControl.java:799)
at core.view.xith3d.component.VHXith3dComponent$1.preRender(VHXith3dComponent.java:41)
… 10 more

Hi…

puuh - had to do many things last week, so no time for answering - sorry…

[quote]KABLAM…any thoughts??
[/quote]
ooops - when does it happen - immediatly after starting or as a cause of some action?

I had this exception, if some window was out of the overlay’s bounds, but i think i clip that case correctly, but it seems to be, that i forgot about another case… :-/

sorry it took so long…life intrudes periodically

it happens right after startup…

hi there

i don’t know if my following idea could work ???:

if you could somehow make parts of the Canvas3D invisible, you could let swing components shine through, so you wouldn’t have to care about placing components above the Canvas3D.

This way you could use all the stuff you can do with swing. :slight_smile:

greetings

Arne