Hi,
I'm experiencing a problem where a simple scene can crash Xith3D. I don't know if I'm doing something wrong or it's a known issue.
I managed to track this to the simplest example. This is based on the SimpleGeometry example from the GSG. The following code starts up correctly and draws the two objects:
VirtualUniverse universe = new VirtualUniverse();
View view = new View();
universe.addView(view);
Locale locale = new Locale();
universe.addLocale(locale);
BranchGroup scene = new BranchGroup();
locale.addBranchGraph(scene);
// draw a dotted cross in the upper-left corner
Shape3D sh3 = new Shape3D(createXPoints(), new Appearance());
scene.addChild(sh3);
// draw a quad in the lower-left corner
Shape3D sh4 = new Shape3D(createQuad(), new Appearance());
scene.addChild(sh4);
// create a canvas for our graphics
RenderPeer rp = new RenderPeerImpl();
CanvasPeer cp = rp.makeCanvas(null, 400, 304, 32, false);
Canvas3D canvas = new Canvas3D();
canvas.set3DPeer(cp);
// modify our view
view.addCanvas3D(canvas);
view.getTransform().lookAt(new Vector3f(0, 0, 2), // location of eye
new Vector3f(0, 0, 0), // center of view
new Vector3f(0, 1, 0)); // vector pointing up
view.startView();
This is a subset of the SimpleGeometry example. However if I comment one of the shapes being added to the scene the window appears for a split-second and crashes instantly without further info:
// draw a dotted cross in the upper-left corner
Shape3D sh3 = new Shape3D(createXPoints(), new Appearance());
scene.addChild(sh3);
// draw a quad in the lower-left corner
//Shape3D sh4 = new Shape3D(createQuad(), new Appearance());
//scene.addChild(sh4);
Just commenting a Shape3D does it. I have tried different ways but have seen always exactly the same pattern: when there is only one Shape3D in the scene (no matter which one) the program crashes.
The problem occurs with any of the examples that use a single Shape3D (ie HelloXith3D)
This is the debug info after starting a Xith3D application:
Init GL is net.java.games.jogl.impl.x11.X11GLImpl
OpenGL Renderer = GeForce2 MX/AGP/SSE2
OpenGL Version = 1.4.0 NVIDIA 44.96
OpenGL Vendor = NVIDIA Corporation
OpenGL Extensions = GL_ARB_imaging GL_ARB_multitexture GL_ARB_point_parameters 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_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_add 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_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
Thanks a lot