Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2] 3
  ignore  |  Print  
  ui xith3d  (Read 10849 times)
0 Members and 1 Guest are viewing this topic.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #30 - Posted 2004-11-04 22:20:53 »

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.

Offline hawkwind

Junior Member




Java games rock!


« Reply #31 - Posted 2004-11-06 16:22:06 »

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

Senior Newbie




Java for Freedom!


« Reply #32 - Posted 2004-11-07 02:57:27 »

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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline hasait

Senior Newbie




Java for Freedom!


« Reply #33 - Posted 2004-11-09 02:59:24 »

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 :-)
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 ;-) - 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)
Offline JeramieHicks

Senior Newbie




Java games rock!


« Reply #34 - Posted 2004-11-09 15:47:04 »

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...



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.
Offline hawkwind

Junior Member




Java games rock!


« Reply #35 - Posted 2004-11-13 23:39:26 »

thanx...time to research this...... Roll Eyes
Offline hawkwind

Junior Member




Java games rock!


« Reply #36 - Posted 2004-11-14 14:50:35 »

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
Offline hasait

Senior Newbie




Java for Freedom!


« Reply #37 - Posted 2004-11-17 16:30:05 »

Hi...

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

Quote
KABLAM....any thoughts??


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... :-/
Offline hawkwind

Junior Member




Java games rock!


« Reply #38 - Posted 2004-11-21 15:02:21 »

sorry it took so long...life intrudes periodically

it happens right after startup..
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #39 - Posted 2004-11-22 20:31:06 »

hi there

i don't know if my following idea could work Huh:

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. Smiley

greetings

Arne

:: JOODE :: Xith3d :: OdeJava ::
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #40 - Posted 2004-11-23 07:07:06 »

hey hasait

your stuff really looks and works nice Cheesy !!!

but theres one thing that bugs me: if the mouse is above these dialogs the speed decreases extremely. (it looks still ok, but this thingi thats rotating there gets pretty slow)
(im running the one from run.cmd)
i don't think, that a framerate decrease in this rate would be too good Sad

:: JOODE :: Xith3d :: OdeJava ::
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #41 - Posted 2004-12-14 22:37:52 »

*bump*

How is work going on these new UI API's?

Xith3D really needs a standard UI package, and those mentioned in this thread seemed promising.

Idealy, once semi-complete these packages could be added to the Xith-tk CVS and distributed along side Xith3D itself.

Will.

Offline SpuTTer

Senior Member


Medals: 1


Lazy Middle Class Intellectual


« Reply #42 - Posted 2004-12-16 06:42:51 »

+1000

Sacramento Volleyball
"Whitty phrase goes here."
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #43 - Posted 2004-12-17 20:30:53 »

I would label an in-game UI system essential.  Xith needs this badly, come on guys, any progress?

Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #44 - Posted 2004-12-18 07:33:19 »

Hi

I got a very simple way of drawing swing above the Canvas3D. It only has one little take back: you cannot have transparent or semi transparent ui.
I just simply use a JLayeredPane and add to the parts where I want to have my UI java.awt.Panels, which draw above the Canvas3D. To these Panels I can then add normal Swing-Components.

Arne

* I don't know any reason why this should decrease the framerate in any way.

:: JOODE :: Xith3d :: OdeJava ::
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #45 - Posted 2004-12-18 14:13:22 »

Quote
* I don't know any reason why this should decrease the framerate in any way.

Good idea, but have you tried it and do the frame rates really stay the same?

Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #46 - Posted 2004-12-18 15:32:18 »

I haven't tried until now, but i think I could be doing that today.

:: JOODE :: Xith3d :: OdeJava ::
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #47 - Posted 2004-12-18 15:52:14 »

If you get it working please post here Smiley

Offline aNt

Senior Member




AFK


« Reply #48 - Posted 2004-12-18 15:56:13 »

well i starting looking into this as noted here. and found
that i soon started making 3d objects and texturing
them as others have here. then using Picking for click
events. this is not so cool because its just not good for
any complex controls (popups, drag and drop). it gets
very messy. but it was worth a try. real downer is text
input- u need to add text highlighting when selecting
words, along with copy and paste. if u need all that sort
of controls then you end up making a 3d awt. this is fine
just takes time. layout managers of X, Y and Z is also a
top thing we can do in xith so i'm looking at that also.
skinning is a must have. i dont think eveyone would
want the same look and feel for there buttons as me Smiley
Davids was very cool when he posted the code for the
game he was making- maybe we should look at that.
wonder if he would mind if we ported it into xith these
days?
Offline aNt

Senior Member




AFK


« Reply #49 - Posted 2004-12-18 15:57:49 »

oh to note- thats why im looking into making a new
file loader. you can then name the objects with there
actioncommands Smiley. maybe also a wast of time but one
has to keep trying and learning the hard way i guess
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #50 - Posted 2004-12-18 17:10:15 »

I don't think copy/paste is that important at the moment.  What is really needed though are just text fields that can accept user info, text boxes that can store chat conversation with a transparent background, etc.

Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #51 - Posted 2004-12-18 17:27:44 »

Hi

I've checked the different fps now:

with ui: 959.67
with ui without clicking any buttons etc: 1036.53
without ui: 1005.38

for the ui I used a JButton and a JTree. It doesn't look to bad, does it? :-)

Here's the main part of the code:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
        JFrame f = new JFrame("ui test");
        f.getContentPane().setLayout(new BorderLayout());
        RenderPeer rp = new RenderPeerImpl();
        CanvasPeer cp = rp.makeCanvas(f.getContentPane(),400, 400, 32, false);
        Canvas3D canvas = new Canvas3D();
        canvas.set3DPeer(cp);
        view.addCanvas3D(canvas);

        f.getLayeredPane().setLayout(new BorderLayout());
        Panel pan = new Panel();
        pan.add(new JButton("click me"));
        pan.add(new JTree());
        f.getLayeredPane().add("South",pan);
        f.setVisible(true);

        view.getTransform().lookAt(
        new Vector3f(0,0,2.41f), //location of eye
       new Vector3f(0,0,0),     //center of view
       new Vector3f(0.0f,1,0.0f));    //vector pointing up
       view.startView();


Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #52 - Posted 2004-12-18 17:54:43 »

Hmm... Nope, can't see the swing components Sad
I'm doing a renderOnce() in a loop instead of startView btw...
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
f = new JFrame("ui test");
            f.getContentPane().setLayout(new BorderLayout());
            RenderPeer rp = new RenderPeerImpl();
            cp = rp.makeCanvas(f.getContentPane(),800, 600, 32, false);
            Canvas3D canvas = new Canvas3D();
           
            f.getLayeredPane().setLayout(new BorderLayout());
            Panel pan = new Panel();
            pan.add(new JButton("click me"));
            pan.add(new JTree());
            f.getLayeredPane().add("South",pan);
            f.setSize(800, 600);
            f.setVisible(true);

Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #53 - Posted 2004-12-18 19:45:31 »

Do you use a Panel instead of a JPanel ??

And try to resize the JFrame at the beginning. It doesn't draw the Swing at the beginning. I think it has to be updated or something.

:: JOODE :: Xith3d :: OdeJava ::
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #54 - Posted 2004-12-18 19:48:26 »

Yeah, just like your code says.

Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #55 - Posted 2004-12-18 20:24:28 »

did you get my change?

:: JOODE :: Xith3d :: OdeJava ::
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #56 - Posted 2004-12-18 21:44:36 »

Um... I don't know what you mean?  Huh
Hey, could you contact me on AIM or ICQ so that we don't clutter up this forum?

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #57 - Posted 2004-12-19 06:18:38 »

Pity about the no transparency, this is quite important for some.

IMHO, we just need a simple solution which can create text input and display boxes.  At least as a start.

Regarding mouse input, personally I think it would be better not to use picking and instead just convert the coordinates.  As this is stricly 2D, I don't think this will be a problem.

Will.

Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #58 - Posted 2004-12-19 08:56:40 »

I think, if we could have transparent heavyweight components (i don't know any way of doing this Sad ), the adding of transparancy wouldn't be to hard then.

:: JOODE :: Xith3d :: OdeJava ::
Offline aNt

Senior Member




AFK


« Reply #59 - Posted 2004-12-19 11:04:24 »

Quote
I think it would be better not to use picking and instead just convert the coordinates.


whats the best way of doing this?
Pages: 1 [2] 3
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (13 views)
2014-07-29 18:09:19

Riven (10 views)
2014-07-29 18:08:52

Dwinin (10 views)
2014-07-29 10:59:34

E.R. Fleming (28 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (40 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!