Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (489)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (555)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Xith3D Forums / Re: Add a Canvas3D to the JPanel on: 2003-10-30 08:21:26
Thanks for your reply.

I need to start a view even though that is not visible.
For example, Let's say I use a JTabbedPane and add three tabs.
The last one contains Canvas3D that is connected to view.
So at first, the third tab is not seen.
I want to start a view at the construct time of the third tab and
forget about it.
In this case, how can I accomplish this?

2  Java Game APIs & Engines / Xith3D Forums / Re: Add a Canvas3D to the JPanel on: 2003-10-29 23:41:49
Hi, Here is modified HelloXith3D version.

           JFrame frame = new JFrame();
           frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           frame.setBounds(100, 100, 500, 400);
           
           JButton click = new JButton("Click");
           frame.getContentPane().add(click, BorderLayout.NORTH);
           
           JPanel panel = new JPanel();
           frame.getContentPane().add(panel);

-->            frame.setVisible(true);

           // create the virtual univers
           VirtualUniverse universe = new VirtualUniverse();

           // add a view to the universe
           View view = new View();
           universe.addView(view);

           // add a locale
           Locale locale = new Locale(5.0f, 0.0f, 10.0f);
           universe.addLocale(locale);

           // create a BranchGroup
           BranchGroup scene = new BranchGroup();
           locale.addBranchGraph(scene);

           // let objects along this path rotate
           Transform3D rotate = new Transform3D();
           rotate.rotXYZ((float)Math.PI/4,
           (float)Math.PI/5,
           (float)Math.PI/2);
           TransformGroup objRotate = new TransformGroup(rotate);
           scene.addChild(objRotate);

           // create Cube
           Geometry geo = Cube.createCubeViaTriangles(0, 0, 0, 1, true);
           Shape3D sh = new Shape3D(geo, new Appearance());
           objRotate.addChild(sh);

           // turn the scene into a render friendly format
           scene.compile();

           // create a canvas for our graphics
           RenderPeer rp = new RenderPeerImpl();
           CanvasPeer cp = rp.makeCanvas(panel, 500, 380, 32, false);
           Canvas3D canvas = new Canvas3D();
           canvas.set3DPeer(cp);

           // modify our view so we can see the cube
           view.addCanvas3D(canvas);
           view.getTransform().lookAt(
                 new Vector3f(0, 0,    2f),    // location of eye
                 new Vector3f( 0, 0, 0),    // center of view
                 new Vector3f( 0, 1, 0));    // vector pointing up
-->            view.startView();

There is a problem.
When I call frame.setVisible(true) before view.startView().
It works.
But When I change the order, I always see the "invalid drawable". error message.

I tested this code on MacOS X Panther(7B95) with September 5th build.

Is this only a problem related with MacOS JOGL implementation?
Which situation can I see "invalid drawable" message?

P.S) My program(other one) use IndexedTriangleStripArray and GeometryUpdater for dynamic geometry update. When I port Java3D code to Xith3D code,
Could you tell me about pitfalls that I must care?

And I use a JTabbedPane in which Canvas3D is attached.
But there is painting problem.
3  Java Game APIs & Engines / Xith3D Forums / Add a Canvas3D to the JPanel on: 2003-10-29 09:48:23
Hi,

I started to convert my Java3D code to Xith3D code.
But I couldn't add a Canvas3D object to the JPanel.
Here is a code fragment.

// create a canvas for our graphics
RenderPeer rp = new RenderPeerImpl();
CanvasPeer cp = rp.makeCanvas(panel, 384 + 54, 384 + 54, 32, offScreen);
Canvas3D canvas3d = new Canvas3D();
canvas3d.set3DPeer(cp);

Is this feature not yet implemented?
Please give me a advice...
4  Java Game APIs & Engines / JOGL Development / Re: JoGL ports: Post them here on: 2003-10-27 08:35:16
I downloaded Nehe tutorial demos and tested those.
But it didn't work.
(I couldn't see no window on windows mode and
could see just a white screen on full screen mode)
On windows mode, I've encountered the following message.
; 2003-10-28 20:23:18.941 java[478] invalid drawable

What's wrong with me?
I tested these on Mac OS X 10.3 with September 5th build JOGL.
Please give me a advice.
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

Nickropheliac (12 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (27 views)
2014-08-22 19:31:30

atombrot (40 views)
2014-08-19 09:29:53

Tekkerue (38 views)
2014-08-16 06:45:27

Tekkerue (34 views)
2014-08-16 06:22:17

Tekkerue (24 views)
2014-08-16 06:20:21

Tekkerue (34 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (47 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!