[JAVA3D] using VirtualUniverse directly
Anyone out there with sample code illustrating the direct use of a VirtualUniverse? I'm trying to get around using a SimpleUniverse. Mark Anyone out there with sample code illustrating the direct use of a VirtualUniverse? I'm trying to get around using a SimpleUniverse. Mark
[JAVA3D] Coordinating View and Canvas3D
I'm having trouble adjusting the view. I wish to draw a single scene graph within my Canvas3D such that it is always entirely visable, no matter what the dimensions of my Canvas3D are. (Ie, if I position the viewer in a place so that he can see the entire thing, I'd like him to continue seeing the whole thing even if the window size changes.) As a result, the scale should be min(canvasWidth, canvasHeight) / 2.0, rather than the default canvasWidth / 2.0. I've tried doing this by putting a component listener on the Canvas3d to detect when it resizes, and then execute the following: if (view != null) { Dimension d = mainCanvas.getSize(); if (d.width d.height) view.setScreenScale(1.0); else view.setScreenScale((double)d.height / (double)d.width); } Unfortunately, this does nothing. I've also tried setting the scale explicity from a text control: String s = text_size.getText(); double d; try { d = Double.parseDouble(s); } catch (Exception e) { d = 1.0; } view.setScreenScalePolicy(View.SCALE_EXPLICIT); view.setScreenScale(d); mainCanvas.repaint(); I've noticed that when setScreenScale() is passed anything above about .0625 then the view acts as if it was View.SCALE_SCREEN_SIZE, and below this number, nothing is rendered at all. Any help on how to set the scale would be greatly appreciated. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Looking for good primer for X3D
Anyone know where I could find a good introduction for X3D? Preferably something in PDF format I could download for free? :) Mark McKay -- We, in all humidity, are the people of currant times. This concept grinds our critical, seething minds to a halt. - Anders Henriksson, A History of the Past, Part II (A collection of excerpts from student papers) === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Antialiasing Failing
Hi, I'm trying to enable antialiasing for a scene I'm rendering in Java 3D. I believe Ive done everything I need to do, but still my scenes are not antialiased. I've tried this on three computers now, each with great video cards. I am: - Making sure to request a canvas with antialiasing abilities GraphicsConfigTemplate3D gct3 = new GraphicsConfigTemplate3D(); gct3.setSceneAntialiasing(GraphicsConfigTemplate3D.PREFERRED); - Checking that antialiasing is enabled on the resulting Canvas3D (canvas3D.getSceneAntialiasingAvailable() returns true) - Enabling antialiasing on my view view.setSceneAntialiasingEnable(true); view.getSceneAntialiasingEnable() returns true However, my polygons are still not antialiased. On top of this, my lines are not anti aliased either, even though I set this option on it's appearance. (My lines are also only one pixel wide, even though I'm giving them a width of 4 in their material). I've even made a call to System.setProperty(j3d.implicitAntialiasing, true); However, this isn't enabling antialiasing either. Could anyone point out what I'm doing wrong? Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Antialiasing Failing
Just to follow up on my last email, here are the results QueryProperties is returning: version = 1.3.1 vendor = Sun Microsystems, Inc. specification.version = 1.3 specification.vendor = Sun Microsystems, Inc. renderer = DirectX Renderer version = DirectX 8.0 or above doubleBufferAvailable = true stereoAvailable = false sceneAntialiasingAvailable = true sceneAntialiasingNumPasses = 1 textureColorTableSize = 0 textureEnvCombineAvailable = true textureCombineDot3Available = true textureCombineSubtractAvailable = true texture3DAvailable = true textureCubeMapAvailable = true textureSharpenAvailable = false textureDetailAvailable = false textureFilter4Available = false textureAnisotropicFilterDegreeMax = 8.0 textureBoundaryWidthMax = 0 textureWidthMax = 4096 textureHeightMax = 4096 textureLodOffsetAvailable = false textureLodRangeAvailable = false textureUnitStateMax = 8 compressedGeometry.majorVersionNumber = 1 compressedGeometry.minorVersionNumber = 0 compressedGeometry.minorMinorVersionNumber = 2 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Switch failing with SharedGroup
I have large number of small, dot like shape objects that are positioned to fall in a long line. I want to animate these such that first the one on one end appears, then a few milliseconds later the next one, then the next, and so on. To implement this, I thought it would be best to create a single instance of this shape under a SharedGroup, and then create many links to it from a single Switch node. This Switch node would be set to be type CHILD_MASK, and I would pass in a BitSet every few milliseconds to set which of my dots should be visible and which should not. Unfortunately, this doesn't work. While this scheme will work fine with non shared geometry, when using links to shared geometry, the shared geometry only appears when every single piece in the set visible. I've tried this on two different machines and received the same results. Is this a bug in Java3D? What would be recommended work arounds? Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Can't write depth info in raster
I have a scene graph and need to label certain parts of it for the user to see. After trying billboards and being unsatisfied with the results, I tried using rasters, which were much faster and looked much nicer. However, they are suffereing from the same problem that my billboards were - when viewed from certain angles, my labels twist to partially embed themselves in nearby geometry. Since these are labels and should sit on top of any geometry, it would be nice to set the depth they write into the depth buffer to be it's minimum. However, no matter what data I write into my DepthComponent, the depth written into the buffer is the same as the raster's root position in my scene graph. Any ideas how to get my raster to do what I want? I've tried both integer and float depth components. //Create raster image of label Image labelImage = AppImageLoader.instance().getImage(AppImageLoader.IM_AUTO_REF_LOGO); int width = labelImage.getWidth(null); int height = labelImage.getHeight(null); BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR); Graphics2D g = bi.createGraphics(); g.drawImage(labelImage, 0, 0, null); g.dispose(); ImageComponent2D ic = new ImageComponent2D(ImageComponent.FORMAT_RGBA, bi); //Create foreground depth buffer DepthComponentFloat dc = new DepthComponentFloat(width, height); float[] depthData = new float[width * height]; for (int i = 0; i width * height; i++) { depthData[i] = 0f; } dc.setDepthData(depthData); //Build raster javax.media.j3d.Raster raster = new javax.media.j3d.Raster( new Point3f(0f, 0f, 0f), javax.media.j3d.Raster.RASTER_COLOR_DEPTH, 0, 0, width, height, ic, dc); raster.setClipMode(javax.media.j3d.Raster.CLIP_IMAGE); Shape3D labelShape = new Shape3D(raster); Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Writing 2D content on top of a Canvas3D
What is the best way to write static 2D data to a Canvas3D? For example, if I wanted to draw a title centered at the top of my screen (which would be positioned relative to the dimensions of it's AWT container rather than scene geometry), what would be the best way to do this? Reading through the docs has left me confused as to the best way to do this. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Raster Depth Information being ignored
I have a raster of data which I would like to draw over top of all geometry in my scene. However, no matter what values I pass to the array which should define the depth information, the color pixelsin the raster are written at the same depth as the point that defines the raster's location in the scene graph. I've also tried a two step process where I first write depth information and then color information in two different rasters. My depth information simply seems to be ignored. Is there any way to get these rasters to appear above all the geometry? Mark McKay private Shape3D buildFgRaster() { //Create raster image of logo Image logoImage = AppImageLoader.instance().getImage(AppImageLoader.IM_AUTO_REF_LOGO); int width = logoImage.getWidth(null); int height = logoImage.getHeight(null); BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR); Graphics2D g = bi.createGraphics(); g.drawImage(logoImage, 0, 0, null); g.dispose(); ImageComponent2D ic = new ImageComponent2D(ImageComponent.FORMAT_RGBA, bi); //Create foreground depth buffer DepthComponentFloat dc = new DepthComponentFloat(width, height); float[] depthData = new float[width * height]; for (int i = 0; i width * height; i++) { depthData[i] = Float.POSITIVE_INFINITY; } dc.setDepthData(depthData); //Build raster javax.media.j3d.Raster raster = new javax.media.j3d.Raster( new Point3f(0.5f, 0.5f, -10f), javax.media.j3d.Raster.RASTER_COLOR_DEPTH, 0, 0, width, height, ic, dc); raster.setClipMode(javax.media.j3d.Raster.CLIP_IMAGE); raster.setDstOffset(new Point(0, 0)); return new Shape3D(raster); } === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Writing 2D content on top of a Canvas3D
Hi James, Yes, I'd like to see your code if you would be kind enought to email it to me. Thanks. Mark McKay James Goldwater wrote: As far as I can tell (and I'm so _not_ an expert at this) - you can't. Although you can get a Graphics2D object from a Canvas3D and draw on that, it absolutely kills performance. The j3d.org packages include examples of overlay classes, which kind-of allow you to fake it. What these do is however a mere convenience: they just insert the relevant 2d objects in the 3d universe at a z=0 position for your viewpoint. I ended up doing this myself manually: I used the LocalToWindow class (found on Sun's java3d-interest mailinglist archives) which translates local 3d coords to window coords, and wrote an inverse function. But that may not be appropriate in your application. (Mail me offlist for the code if you want). I look forward to being contradicted! James. Mark McKay wrote: What is the best way to write static 2D data to a Canvas3D? For example, if I wanted to draw a title centered at the top of my screen (which would be positioned relative to the dimensions of it's AWT container rather than scene geometry), what would be the best way to do this? Reading through the docs has left me confused as to the best way to do this. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. -- James Goldwater I.T. Consultant 020 8949 7927 (mobile 078 999 55 265) Preferred GPG Key: A2137B98 (pgp.mit.edu) === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Writing 2D content on top of a Canvas3D
James Goldwater wrote: As far as I can tell (and I'm so _not_ an expert at this) - you can't. Although you can get a Graphics2D object from a Canvas3D and draw on that, it absolutely kills performance. And causes lots of native exceptions to be thrown. The j3d.org packages include examples of overlay classes, which kind-of allow you to fake it. What these do is however a mere convenience: they just insert the relevant 2d objects in the 3d universe at a z=0 position for your viewpoint. What do you mean? Does this write raster data? I've tried (with some sucess) to position raster objects under a transfom that's identical to the one for my viewing platform. Effectively you can draw 2D objects this way. Unfortunately, if you have any geometry which comes close to the eye, it pokes through your labels. Woudl you think I was on the right track with this method? I ended up doing this myself manually: I used the LocalToWindow class (found on Sun's java3d-interest mailinglist archives) which translates local 3d coords to window coords, and wrote an inverse function. But that may not be appropriate in your application. (Mail me offlist for the code if you want). Have done so. Thanks for the help. I look forward to being contradicted! James. My other idea was to create an offscreen Canvas3D and draw my 3D data into a BufferedImage which I could then mangle however I wanted and bitblt into an ordinary Swing component. Are there any drawbacks to this method you would know of? (Another 2D question: in my experience, BufferedImages are quite slow which is why I still manipulate all my image data with Java 1.0 image producers and consumers. Would a BufferedImage have a performance hit with J3D? How useful would learning about generic RenderedImages be?) Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Writing 2D content on top of a Canvas3D
Justin Couch wrote: Mark McKay wrote: The j3d.org packages include examples of overlay classes, which kind-of allow you to fake it. What these do is however a mere convenience: they just insert the relevant 2d objects in the 3d universe at a z=0 position for your viewpoint. What do you mean? Does this write raster data? I've tried (with some sucess) to position raster objects under a transfom that's identical to the one for my viewing platform. Effectively you can draw 2D objects this way. Unfortunately, if you have any geometry which comes close to the eye, it pokes through your labels. The difference is the overlay packages are full 3D textured objects in-scene rather than raster objects. In either case, you end up with the same effects when objects get too close. I've tried to get the overlays positioned as close to the minimum clip distance, but you still do end up with the intersection problems at times. Either way, there is not much you can really do about it as both objects exist as 3D elements in the 3D world. The only real way of doing this is using 2D draw routines over the window. Java3D has traditionally been quite poor in performance with this path though. A change was put into 1.3 that allowed you to blit an image through the Graphics3D class for decent performance. The idea was you would draw everything to the image, then blit the image in the preSwap() method on canvas to get your 2D effects. I've never tried it myself to see the sucess or otherwise of this tactic. I've tried this myself. It has good performance, as far as I can tell. There is a drawback - if you attempt to drag the component performing the drawAndFlushImage() onto another monitor, J3D will throw a native exception and crash. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Finding 3D points on 2D viewing screen
I have a number of points in my scene graph that I would like to know the 2D coordinates of on my Canvas3D. This is so I can position Java2D labels adjacent to these points. Translating the points into view space isn't too hard, but Java3D completely encapsulates the viewing frutsum, so I do not know how to determine where these points end up after projection. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] camera location at start-up
Flavius wrote: normally the camera starts at (0,0,0) right? is there a way to change this? thanx === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. Place the camera under a TransformGroup. This will allow you to position the camera anywhere you want. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Problems with stearing the camera angel with the mouse
Fredrik Andersson wrote: Hello! I try to write a class that implements the mouseinterfaces. When the user moves the mouse the camera should update its viewing-angel. To develop this I use a colorcube as stand in for the camera. I update the colorcubes angel at X and Y axles. But now I have a problem when I try to update both the angel for looking up/down and looking left/right. I end up with a unwanted rotation around the Z-axle. I attach my class for this. You should be able to just compile and test it. I have /* */ the code for rotating the cube in left to right. So when you try it it will just update the angel for looking up and down. When you enter the mouse it helps if you enters the mouse between 0 - 199 at Y-axel. Uncomment the code for looking left to right and se what happens. It will also be a unwanted rotation around the z-axle. So any help to solve this unwanted rotation around the z-axle would be great. Also suggestions for a better idee for this is appreciated. Best regards Fredrik === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. This is a common problem with Euler angles. For anything except simple rotations around an axis, they quickly become hard to wrok with. You may want to investigate quaternions. There are Quat4f and Quat4d classes in J3D to help you. Quaternions let you rotate around any arbitrary axis and are the preferred way to implement complex rotations. If v is a unit vector you want to rotate around by A degrees, then do: Vector3d myAxis = new Vector3d(1, 1, 1); myAxis.normalize(); double sinA = Math.sin(A); double cosA = Math.cos(A); Quat4d myRot = new Quat4d(sinA * myAxis.x, sinA * myAxis.y, sinA * myAxis.z, cosA); Plug this into a Transform3D, and you will be able to rotate by A degrees around (1, 1, 1). Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] java3d
Tom Govaert wrote: Dear Sirs, I was wondering if someone could help me with this Everywhere I look on the web I see things about how to program java3d. But what I need to know is, is how java3d works. (hardware, software..) How the highlevel API works with lowerlevel api directx. What the main differences are between programming directx and programming java3d. Whats the best of the two. And how come that if I try to run a class file where the 3dapi isnt installed but directx is, I get an error. Does every computer that needs to run a java3d program needs to have the java3dapi installed ? That would seem very strange to me. If someone could help me please, I would be very grateful. Kindest regards, Tom Govaert === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. In a nutshell, Java3D is a set of ordinary Java classes with native extensions. In Java, native code is like a DLL. Native code is written in another programming language (most likely C++) and compiled with certain headers which make it visible to the Java virtual machine. The higher level Java3D classes can then find the native libraries and complete the bridge from machine to Java program. Since the nature of 3D rendering differs so much from platform to platform, quite different Java3D distributions are needed for each machine. You cannot run Java3D applications without installing Java3D seperately. (Although there's an interesting thread in the Sun forums of someone trying to do everything at once through WebStart alchemy). Sun promised at some point in the past to include Java3D as part of WebStart, but has so for not followed through on that. If enough folks bug them with email, we may be able to fix that. :) Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] java3d
Tom Govaert wrote: Thank you very much. So if I understand correctly JAVA3DCLASSES + DIRECTX DDL's (native code) make it possible to run a program on the java virtual machine. You need the DIRECTX to get hardware support for your program ? What is the difference then of programming directly into DIRECTX ? If you install de DIRECTX API and SDK and program in visualstudio.net, what are the differences with programming JAVA3D. If anyone knows any good websites about this, please mail them to me. Kindest regards, Tom Govaert Any Java program will need Java classes in order to run. And since Java has no innate ability to render 3D graphics, it's necessary to also have some native libraries to do the low level work of the 3D rendering. Java3D comes with both of these, so there's no low level programming you need to do yourself. DirectX is not hardware, but rather a set of DLLs that Windows uses to draw 3D graphics. Other systems such as Linux use OpenGL (Windows has OpenGL too). All modern versions of windows ship with both. Java3D has two distributions, the OpenGL and the DirectX versions. The same Java3D code will run on either distribution, so it's really up to the user which version to install. The OpenGL version is slightly more efficient (and stable), so it's the distribution I use. There is not really a way to program 'directly' in DirectX. If you program in C++, you will still need to link with the DirectX DLLs to get any function out of it. Ie, instead of using a Java API to access DirectX, you will be using a Visual C++/C#/Visual Basic API. The language you choose to program in is largely independant of the underlying graphics systems. If you go to your local bookstore, you should find plenty of Microsoft oriented books describing how to program in 3D the Microsoft Way(tm). Or you could do it in Java and do it the Sun Microsystems way. It's really up to you. I know I prefer Sun's implementation. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] java 3d room
David Murtagh wrote: Hi all, Im new enough to java 3d and could do with any help! Anyone have any ideas bout making a wall/room in java 3d. Have tried this code but it wont work properly. Any help is gratefully accepted, Thanks. Code: public voidbuildWall(int from, int to) { QuadArray plane = new QuadArray(4, GeometryArray.COORDINATES|GeometryArray.TEXTURE_COORDINATE_2); Point3f[] pts = new Point3f[4]; plane.setCoordinate(0, gridPoints[from]); plane.setCoordinate(1, gridPoints[to]); float x1 = gridPoints[to].x; float y1 = gridPoints[to].y; float z1 = gridPoints[to].z; plane.setCoordinate(2, new Point3f(x1, y1 + height, z1)); float x = gridPoints[from].x; float y = gridPoints[from].y; float z = gridPoints[from].z; plane.setCoordinate(3, new Point3f(x, y + height, z)); TexCoord2f q = new TexCoord2f(); q.set(0.0f, 0.0f); plane.setTextureCoordinate(0, 0, q); q.set(1.0f, 0.0f); plane.setTextureCoordinate(0, 1,q); q.set(1.0f, 1.0f); plane.setTextureCoordinate(0, 2, q); q.set(0.0f, 1.0f); plane.setTextureCoordinate(0, 3, q); Shape3D wall = new Shape3D(); wall.setGeometry(plane); Appearance appear = new Appearance(); appear.setMaterial(new Material()); appear.setPolygonAttributes(poly); TextureLoader texLoader = new TextureLoader(bricks.jpg, null); Texture2D texture = (Texture2D) texLoader.getTexture(); TextureAttributes texAttr = new TextureAttributes(); texAttr.setTextureMode(TextureAttributes.MODULATE); wall.setAppearance(appear); wallGroup.addChild(wall); === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. You could create a room in a 3D modeling program such as Maya and export it to a file (such as VRML) and use jX3D to load it into memory. If you don't have money to buy such a program, you may want to download Blender, a fairly decent freeware modeling program. Or you could create a Box object and scale it to an appropriate size. Creating geometry by typing in a lot of datapoints is very painful and I would not recommend it. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Java3D for Macintosh?
I understand that Java3D has been recently ported to Mac, but am unable to find any Mac downloads from the Java3D download site. Where would I be able to find this? How stable would the Mac release be? Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] run java in internet explorer
John Wright wrote: Tom, You don't have to put any special code in. What you have to do is make sure Java 3D is installed in the JVM that the browser is using. So if IE is using Microsoft's JVM then you need to switch to Sun's JVM (and make sure whichever one the browser is using has Java 3D installed in it - multiple JVM installs do cause a lot of trouble). In case you're not familiar with IE - in the Internet Properties dialog under the Advanced tab if you scroll down you'll find a check box (or two) for selecting which JVM you want IE to use. - John Wright Starfire Research You may also need to use something other than the applet tag. Support for this tag is spotty among browsers; some will ignore the installed Java and instead use a version of Java 1.1.2 that ships with the browser. The way around this is to use different HTML that uses the Java Plugin. Or write deploy your application with WebStart. Info on both of these are available on the Sun website. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] view problem
Yuefeng Kang wrote: I load a vrml file which is a cylinder (d=105mm, h=180mm) to java 3d viewer but I can not see it clearly. The code is like following, Transform3D viewTrans = new Transform3D(); Transform3D eyeTrans = new Transform3D(); sceneBounds = (BoundingSphere)branchRoot.getBounds(); Point3d center = new Point3d(); Vector3d temp = new Vector3d(center); viewTrans.set(temp); temp.x = 0.0; temp.y = 0.0; temp.z = 200; eyeTrans.set(temp); viewTrans.mul(eyeTrans); universe.getViewingPlatform().getViewPlatformTransform().setTransform(viewTrans); only when I set temp.z = 200 I can see something otherwise nothing shows up. I also loaded a small cylinder(r=1) before and set temp.z = 10 and it works great. Anyone can tell me anything wrong within my code? === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. You will only be able to see objects that appear in front of your View object. Just like a camera cannot film objects that are behind it, the View will not render objects that are behind it either. By setting temp.z to 200, you are moving the camera back far enough to see your objects. Try playing with different temp.z values to determine where the best place to position your view is. Alternatively, keep your view in place and move your objects back into space by giving them a negtive translation along z. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Xj3d M8 download page
Jeremy Pitten wrote: Does anyone know of an alternative to the web3d.org download page for the Xj3d M8 release? I'm trying to get hold of an uptodate vrml97 to x3d converter tool and believe one is bundled with this release. Jeremy === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. Have a look at http://ovrt.nist.gov/v2_x3d.html. It's a fairly easy to use converter between Vrml97 and x3d. You'll have to hand edit the embedded URLs after translation, though, as it doesn't do this properly. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] How do you determine frame rate?
I've read a couple of discussions here describing the frame rate of their application, and was wondering what one did to gain access to this information. Does this mean you're using immediate mode and counting the frames yourself will calls to System.getCurrentTimeMillis()? Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Application Built on Java 3D APIs: Flowing Water + 3D Bird + 3D Shark
WorldShow3D wrote: We just developed a 3D application through using Java 3D APIs and the WorldShow3D browser in the package form. After you start this application, you see flowing water, thundering waves, moving clouds, flying 3D birds, swimming 3D shark, and rocky 3D island. When you click the bird, it will chirp; when you click the shark, it will swim faster. Click other part of the screen and then move your mouse, you can navigate on the sea. Click Exit to stop the program. This program is Free. Just download it and try by yourself. For Windows (2000, XP and NT), if your system already has Java 3D installed, you just need to download the following executable (669KB) and run it. http://www.worldshow3d.com/releases/seabird.exe If you want to try it on other operating systems, please let me know. Any feedbacks from you are appreciated. Thanks, It sounds interesting, but I'm not going to download and install an unknown exe on my computer. Woudl you perhaps have a webpage with some screen shots? Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Native Skinning
I was wondering how high a priority it would be for the folks at Sun to implement an extension to Java 3D that would allow users to use skeleton bones and skin techniques to deform mesh geometry? Such a system ought to be fairly straight forward: create a BoneGroup which extends TransformGroup to implement the skeleton hierarchy and a SmoothSkin that extends Leaf and who's constructor accepts an Appearance, a GeometryArray, the root of a BoneGroup hierarchy and a vector of vectors of weights that describe per vertex the amount of deformation each bone contributes to the displacement of the vertex from it's GeometryArray position. I've been thinking of implementing such a thing in software, but know it would run way too slowly. If the Sun engineers think this would be a good idea, I'd like to hear from them. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Java3D native skinning
Alex Scheran wrote: Hi! I have red your post at the Java3D forum and i'am also very interested in that. I also work on a software solution to skin meshes using a skeleton animation system, but i'm also very frustrated about the rendering speed. So i would be thankful, if you can tell me your experience with that. I havn't finished my implementations, only vertex-based mesh modifications and skeletal animations are ready to use (check out the screenshot). If your are interested to exchange some ideas, please reply to this. Best Regards! Alex Oh, very nice image. Unfortunately, I don't think that this program can be solved without resorting to native methods. Skinning is about crunching a lot of numbers quickly, which means that it ought to be handled with native routines. The best scenerio (from my point of view) is to have a couple of extra classes added to J3D that would facilitate this. It would allow users to have the support and platform independance of Java, plus the speed and possible hardware acceleration. Otherwise, I'm either going to have to write my own native methods and be restriced to one platform and have lots of problems with distribution, or write everything in software and have it run really slowly. My best aproximation of skinning so far is generating many keyframe meshes and linking them together in a Morph node. However, this causes some bad squashing between frames. I'm afraid I'm stuck without taking some large programming detours that would undermine using Java in the first place. However, I'm sure it is possible for this problem to be solved. If any folks working with Sun want to look into this, or perhaps even start an open source process where everyone could contribute to this very useful extension, I think that would be the best option for everyone. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Java3D native skinning
Silvère Martin-Michiellot wrote: I did produce a package to do some skinning supporting HANIM spec. If you want to add support for mesh deformation, well that is ok for me. :) Two remarks: Don't expect anything from Sun on this. (After all you could also ask for networking... and this would finally require many extensions) Java is quite fast now and native, well, is native. I'd like to look at your package. Where is it? Your homepage seems to have been down since October. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Fast Java Math (was [JAVA3D] Java3D native skinning)
Silvère Martin-Michiellot wrote: Two remarks: Don't expect anything from Sun on this. (After all you could also ask for networking... and this would finally require many extensions) Java is quite fast now and native, well, is native. Over the past couple of years, I've come to really like the clean design of Java and the convenient suplimentary libraries provided by Sun. However, justified or not, I still have the nagging idea that Java is slower than a compiled language such as C++. If I impliment skinning on my own, I'll need to have two GeometryArrays (one as a source mesh and the other as the destination). Each frame, for each vertex I'd have to perform a weighted sum of each vertex transformed by each bone it is associated with. Practically, this would average out to 3 transforms, 3 scales by a float and 3 sums per vertex per frame. What's the best way to handle this? Just use ordinary Transform3Ds and Point3ds in my Java classes? Use statically declared arrays of double[]? Is there something useful in NIO I ought to look into? (as far as I can tell, NIO just allows fast access to local files and sockets) In general, what is the speediest way to do a lot of number crunching in Java? Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Java3D native skinning
Silvère Martin-Michiellot wrote: At 21:22 09/03/2004 -0500, you wrote: Silvère Martin-Michiellot wrote: I'd like to look at your package. Where is it? Your homepage seems to have been down since October. Send me a personal email at [EMAIL PROTECTED] with your email address, I'll send you a copy or a ftp directory to download the file. I am very busy finishing jsci.sourceforge.net and people might be interested to know that there will be code for physics simulation and astronomy simulations (star systems) available in a week or two on this website. This is the reason why my website is not yet upgraded with a new version. Cheers. Thanks for your offer. :) However, I decided to go ahead and implement it in software, and just finished up this morning. I'm pleasantly surprised how well Java can handle the task. Good luck with your scientific package. It looks like it could be quite useful. I liked the graphing applets you had up there too. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Java 3D beans
Robert Gomez-Reino Garrido wrote: Hi people, I know that this is not the place to post this but I tried in Java Beans forums and nobody replied me, looks like there is not a lot of activite there! And, on the other hand, here I had always a fast and nice answer :) The thing is that I would like to put some of my Java 3D worlds in beans to use them from an Scada software as active x controls. I just start reading about beans and I download the BDK but I am having some problems with the beanbox so I am staked! Apparently it is having problems loading the jar files. Can anybody, please, help me with this? The best would be that you answer only to me instead of answering to all the list. Sorry again. Cheers, Bobby [EMAIL PROTECTED] I'd recommend not using the Bean Box at all. NetBeans is a much nicer way to develop, test and deploy beans. In a nutshell, a Bean is just a regular java class in which you are careful to follow certain naming conventions for getting and setting variables and registering events and listeners. If you need extra control, you can also create a class that derives from a BeanInfo that provides meta information to your editor. Download NetBeans and read the online docs about developing with beans. Then read up on beans in general. This should be all you need. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] java3d savers
bob wrote: Hi, Nice demos. Am I correct to include that in that case I might as well put my applet tool in my site, since your solution needs the JRE and java3d classes as well? Also your applet demands full access to machine and network (with a note that strongly advises against it, I took the risk anyway :-) ), is that always necessary? Thanks, Lars It shouldn't be. That window only appears if you include the security all-permissions/ /security tag in the JNLP file, and you only need to include this if you are going to be accessing local files, the network, or other sandbox unsafe things. The applications don't look like they need this, so it may be helpful if the CAVE staff remove this from the JNLP file. Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Can J3D bump/normal map?
I was wondering if J3D was capable of bump mapping (in browsing the archives, I saw hints that bump, normal and reflection mapping was possible, but no instructions on how to actually do this). Is this possible? Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Strange error of Java3D 1.3.1_02
Andy Dunmore wrote: Did anyone ever find a solution to this (Fail to Reset() D3D device, try Recreate device again. - D3DERR_DRIVERINTERNALERROR) error? I've also been struck by it, but have managed to sneak my way around it by not letting the Canvas3D be resized to 0 (I've set it's setMinimumSize to 1). It would be nice to know if there are any other ideas around that help with this problem. Andy === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. I get around it by destroying and recreating the window. I encounter this error when dragging a Canvas3D between two diffrent monitors. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Can J3D bump/normal map?
Paul Gordon wrote: Hi Mark, Bump mapping can be acheived using DOT3 texture combine mode, but unfortunately there is a bug with multi-layer texturing that I haven't been able to circumvent yet, so you can't bumpmap something that already has a texture on it. Hopefully when the source is released we can fix this :-) Mark McKay wrote: Fair enough. What about normal mapping (ie, an RGB image where pixels represent a normal vector at a a given texture coordinate)? This strikes me as an extremely useful feature which is starting to get wide usage. Post when the bump mapping bug is squashed. :) Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] What are the bugs in Sound?
I've been reading the posts about the buggy sound system on this mailing list for a couple of months now. I'm about to add sound to my J3D project, and am wondering what gotchas to watch out for. I need a pure Java solution, and have been wondering if it might be best to skip the Java3D sound and use the java.sound.* classes instead. What problems does the sound engine have? Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Can J3D bump/normal map?
Paul Gordon wrote: Fair enough. What about normal mapping (ie, an RGB image where pixels represent a normal vector at a a given texture coordinate)? This strikes me as an extremely useful feature which is starting to get wide usage. Ah yes, this is in fact what I am describing. The program is fed a graphic where the difference in greyscale intensities corresponds to the displacement in the z axis of the points of a triangle representing the 3D surface. Multiply the triangle normal by a light vector for each triangle and you get the highlights/shades corresponding to the bumps. I've got this down pat. You need to use DOT3 combine mode to applying this light effects map to the object's existing appearance, but this is where is fails, giving you a very funky but very incorrect result. Normal mapping is different from this. Rather than a greyscale image that fakes extra height, normal maps provide more information, giving you a normal vector on a per pixel basis. It provides a much more realistic effect than simple bump mapping. Here's one of the better demonstrations I've found. It has a very low poly model that after mapping looks almost raytraced. http://www.drone.org/tutorials/normal_maps.html Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] the Need for Speed debate
Florin Herinean wrote: here are my 2c: 1) carefully design your scene. Don't use TransformGroups if you don't plan to dynamically move the objects bellow. A static branch containing many TransformGroups is a waste of resources which results in poor performance and a high memory usage. Collapse whenever possible such static branchgroups to Shape3D's or, if possible to single geometries. I thought compiling a scene would walk the scene graph and eliminate unnecessary Transform groups, and even go as far as to merge a static tree into a single Shape. Am I wrong in this? Mark McKay -- http://www.kitfox.com === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Scene exporter
I've spent about a month writing a pretty detailed model exporter for Java3D games, which I intended to use as a substitute for VRML/jX3D. I designed it to be optimized for use in for games, and specificly Java3D games. Unfortunately, I find my employment situation shifting, and am not sure if I can go the next step and develop a game with my engine. I'm writing to this list to get suggestions about what I should do next. Some nice things my engine can do: - Tag geometry in your editor to be visual, collision and/or sensor geometry. The loader generates three seperate trees, so the collision tree is seperate from the visual tree which makes picking against it a snap. It even shares the geometry data, so no data is duplicated. - Animate with true keyframes. My engine interpolates between keyframes, where as VRML seems to draw from a static list of values. - Skinned bone models. I've implemented in software a realtime skinning algorithm. - Multiple animation channels. Drawing from the Maya notion of 'characters' and 'channels', one can have multiple animation channels per exported model. So you could create one model with one animaiton of the character walking, and another running, and switch to the appropriate animation in game code. - Shared memory for instanced geometry. If you instance geometry in your source scene, only one copy of the geometry is kept in memory. So if you create a street with eight identical lampposts (each an instance), you only have a memory hit for one model. - No link nodes. I found that link nodes caused odd behaviour in my Java3D programs. This was the primary reason that I decided to abandon jX3D. - Low level. My engine avoids using behaviours and instead provides it's own threading for animation. It also provides seperate trees for visual, collision and sensor geometry, so wakeup behaviours are not necessary and picking can be done fairly directly. While it does not currently use JOGL or similar, it should be easy to adapt it to do so. - Includes level of detail, fog, cone lights and other neat nodes like that. Some drawbacks: - Uses my own XML based file format to save scenes/models - Currently an exporter only exists for Maya. I call my new file format Salamander3D. Let me know if this is something that would interest folks. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Robot Arm Simulation
Alp Yilancioglu wrote: Need Help! This is my thesis project for the university and I have got only 10 days to finish this project. I need help because I dont know The java3d package methods. I am making a robot arm simulation. I wanted the user to give the coordinates as an input and the arm will go to the given coordinate Joint- How can I make joint/ link between objects? How can I make a hierarchical structure? Which classes should I use ? Please someone help === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. You're going to want to spend a bit of time looking through the docs and examples. Java3D is non trivial. The basic structure you're looking for is: SimpleUniverse { BranchGroup { Light {} TransformGroup { Shape3D (shoulderShape) TransformGroup { Shape3D (elbowShape) TransformGroup { Shape3D (wristShape) } } } } } Go to the directory where you installed Java, and look for the directory with the Java3D examples. Open the index page in your web browser (on my system this is C:\j2sdk1.4.2_04\demo\java3d\index.html). Play with the examples and look at the source code to see how they work. You may also want to look at http://java.sun.com/developer/onlineTraining/java3d/j3d_tutorial_ch2.pdf Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] ....robot arm simulation
Alp Yilancioglu wrote: thank you for replying my message. I have lots of problem with this thesis project, I need your help , like i have to rotate an arm by the angles given from the user as an input to a destination. I have to calculate all the mathematical thing by my self. Waiting for your answers.. thank you.. ---OLD MESSAGE--- *From:* Alp Yilancioglu [mailto:[EMAIL PROTECTED] *Sent:* 24 Mays 2004 Pazartesi 04:11 *To:* '[EMAIL PROTECTED]' *Subject:* robot arm simulation Need Help! This is my thesis project for the university and I have got only 10 days to finish this project. I need help because I don't know The java3d package methods. I am making a robot arm simulation. I wanted the user to give the coordinates as an input and the arm will go to the given coordinate Joint- How can I make joint/ link between objects? How can I make a hierarchical structure? Which classes should I use ? Please someone help... === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. Rotations are best handled with quaternions. To rotate things nicely, create two Quat4f quaternions representing starting and ending angles and call interpolate() to smoothly blend between them. On the other hand, quaternions take a bit of time to understand correctly, so you may simply want to create a Transform3D and use setEuler() to orient it with Euler angles. If you don't know how to program in Java3D, it may take you more than ten days to both learn how to use it and write your program. If this program is only a minor part of your thesis, you may want to ask your professors for an extension on this part of your project. I'd also highly recommend reading that online book I posted in the last email. It's pretty short, and contains most of what you need to know to program in Java3D. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] J3DGraphics2D drawAndFlushImage Scaling Problem
Mike Pilone wrote: Hello, I am using J3DGraphics2D to draw over my canvas. It is implemented such that I draw into a buffered image, then draw this buffered image on the canvas using J3DGraphics2D.drawAndFlushImage(...). I found that if I draw directly using the graphics from Canvas3D.getGraphics2D(), the 2D drawing looks correct and scales appropriately as the canvas resizes. However, if I draw into an image, then draw that image onto the canvas, it appears to be stretched by about 1.5 as the width of the canvas grows or shrinks. I have attached a slightly modified version of a J3DGraphics2D sample application that was posted to this list a while back. In the postRender section there are two commented sections: the one that works and the one with the scale problem. Uncomment one of them and compare the problem. I might also add that the scale problem only occurs when Java3D is trying to share the buffer (the image is type 4BYTE_ABGR). Using TYPE_INT_ABGR scales correctly, but that is most likely because Java3D is copying the image. This is on Win2K, OpenGL, NVidia. I can get exact driver information if required. There was a previous mention of this problem by another developer, but no confirmations: http://archives.java.sun.com/cgi-bin/wa?A2=ind0202L=java3d-interestP=R6441 4I=-3X=5A1EBB1D99C73E85F9[EMAIL PROTECTED] That developer was using ATI and saw the problem. Thanks, -mike I noticed this two. Java3D seems to automatically scale your image to match the new screen size. I believe this annoying behaviour is related to the viewport being given both a physical size and a pixel size when you first create your view. The way I got around this was to catch the screen resize event and create a new Canvas3D whenever the user resized the canvas. I prefer having my 2D images render with a 1:1 pixel aspect. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Robot Arm Simulation
Alp Yilancioglu wrote: Hi again.. How can i recompile the scene. i want to make my robotarm -to pick an available shape from the eviroment and put it to a another given x,y,z coordinate i make it like this. during runtime my robot arm goes on to the shape to pick it. and i add the shape to the robot arm.. like lowerArm.addChild(Shape3D); but when i done this rendering during the runtime stops. is this right? or Wrong? if it is wrong how can i pick an object during runtime. if it is right. then how can i re render or re compile the scene which is created with in a simpleUniverse? When you compile a scene, the Java3D parser walks the scene graph and makes tweaks that optimize performance at the expense of limiting functionality. There are two ways to keep the ability to change the graph after it starts rendereing: - Call set|Capability() to enable a certain capability to exist after the graph is compiled (such as myTransformGroup.setCapability(TransformGroup.||*ALLOW_TRANSFORM_WRITE cid:[EMAIL PROTECTED]*|)) - Don't compile the graph in the first place Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Looking for Java3D jobs
I have worked with Java3D both professionally and as a hobbiest for about four years now, and am wondering if there are any companies out there that may be looking for someone with my skillset. I am currently job hunting and sent my resume to many graphics companies, but have yet to come across comany specifically looking for Java3D. Are such companies out there? Would anyone be able to suggest companies to look into? Thanks Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] ANNOUNCEMENT: Java 3D source code now available!
I've developed what I consider to be a useful sketeton and smooth skinning system which I believe would be useful for Java3D. Is this the sort of thing the project would be interested in? If so, would there be a way I could contribute? The java.net forum doesn't seem to be allowing anyone to submit code at the moment. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Skinning System for Java3D
I've posted an archive file with Java3D related things on my website. Although the archive itself is fairly large, the skin and bones specific stuff consists of two files. There's a write up on them here: http://www.kitfox.com/salamander/3d/skinAndBones.html The archive can be downloaded at http://www.kitfox.com/salamander/. It represents about two and a half months of work on what I intended to be a distributed MMORPG style engine. However, time and money constraints have focused my attention towards a Real Job, so it's essentially abandoned at the moment. It contains some useful things, such as Flash style menus and a 3D file format and importer for game levels and character animations (as well as an exporter from Maya). Let me know what you think. If folks are interested, I may continue to develop parts of it. As much as I would like to continue to develop Salamander into a general purpose gaming engine for Java, I've come to understand what a huge undertaking this is and something that I cannot accomplish on my own. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Skin question
Serge Bernier wrote: Hi, Nikolai V. Chr wrote:à When I tried exporting animation from 3ds to vrml, it did not export this link. It exported keyframes. And btw. vrml does not support skinning/morphing. Exactly, a 3ds animation to vrml create a bunch of files accordingly to the keyframe of the animation. I reconstruct the bones structure from the information in the first vrml file. After that I search in the other files only the information about the mouvement of the bones. The rest of the job is to attach skin. I know the information is not in the VRML files but I dont know if 3ds export that information in another format (ex: ascii file)? Is there any other option when you export the animation to vrml file (like export bones and mesh)?? Thanks Serge Bernier Selon Nikolai V. Chr. [EMAIL PROTECTED]: Serge Bernier wrote: Hi all, I dont know how 3ds make the link between the mesh and the bones. When I tried exporting animation from 3ds to vrml, it did not export this link. It exported keyframes. And btw. vrml does not support skinning/morphing. Regards Nikolai Agreed. VRML does not support skinning, and does not interpolate between keyframes either, both of which make it unsuitable for video game content. If you're interested in creating a plugin for 3DS Max that can export skins, you might want to look in to porting the plugin I've created for Maya at http://www.kitfox.com/salamander/3d/salamander3d.html. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] morphing, 3ds objects and the Starfire loader
Paul Brown wrote: Hi, I've been pleased to see the interest in skin bones animation triggered by Mark's contribution recently. These are once again exciting times now that the Java3D code has become an open source Java.net project. OK, enough of that, on to my problem... I'm trying to morph between objects created in 3D studio max and imported into Java3D using the excellent Starfire loader. The different versions of the objects have been saved to different files. With some of the morphs, I get a weird effect in which the object appears to fragment before reassembling itself. This looks interesting but is not want I want. I suspected that this was caused by the corresponding vertices being read into my geometry arrays, through the loader, in a different order for the offending files. This was confirmed in the log generated by the loader. Other morphs work - and again, the logging shows that in these cases, the corresponding vertices are read in the same order. My question is how does 3D Studio Max store the coordinates of the vertices? Is there any way to ensure that they are stored in the same order between files? And/or is there any way to ensure that the Startfire (or any other) loader reads them in the same order? Many thanks, -Paul Hi Paul, Originally I tried using morphs for animation, but decided to abandon them (and develop the skinning system) because even though they worked correctly, they usually look bad when they animate. Unless you're going to go to the extreme of defining every frame of animation (which takes a lot of memory), morphing interesting objects produce odd, squished inbetweens. I'm not sure how your loader stores verticies specifically, but you may want to try exporting low vertex cubes and tetrahedrons and looking at the verticies directly when you load them in. Vertex order would be critical for the Morph node to work properly. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Illustrator/SVG graphics?
One thing you could try is to read the SVG in as Java2D shapes and then try to convert the 2D path shapes to 3D ones. I've written a light weight SVG parser which will soon be uploaded to https://svgsalamander.dev.java.net/. Currently you can find it at http://www.kitfox.com/salamander/index.html Mark McKay -- http://www.kitfox.com M. Halpin wrote: I have a bunch of art in Illustrator that I'd like to render as flat polygonal meshes. By default, AI can export to SVG and DXF: the SVG files look pretty good in third-party SVG viewers, however the DXF files look awful (not to mention that only a few components of them actually load using the DXF loaders referenced on j3d.org). Anyway, so I was wondering if anyone knew of a way to load/convert SVGs into something Java3D can render as polygons? (Rasterizing to a texture isn't really an acceptable option). I figure it must be possible, especially since svgl can render these sames SVGs as polygons in C using OpenGL. Thanks. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Illustrator/SVG graphics?
The latter, although more verbose, could be manipulated by standard XSLT methods. The former requires deep XPath kung fu and declarative recursion programming to pick apart. The SVG folks went for conciseness rather than ease of transformation. :-( If you're lookiing for a good SVG reader, you could try my new project at https://svgsalamander.dev.java.net. It will read and transform your shape correctly, and you can query the 2D scenegraph to get the shapes directly. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Java3D to be used for tennis instant replays
Here's a cool Java3D application about to take the sports world by storm: http://www.auto-ref.com/pages/711020/index.htm AutoRef is a system that uses cameras to monitor a tennis game in progress and uses computer vision algorithms to analyze the image and determine where the ball is in 3D space. Then the data is sent over a network to a game play server, and from there to multiple 3D clients (I wrote both the server and clients). Data is buffered, the current score is determined, and 3D displays of instant replays are shown onscreen. The system has been tested at the US Open and even made the newspapers (in response to the bad umpire calls that lost Serina Williams the title): http://www.mercurynews.com/mld/mercurynews/sports/9612481.htm?1c http://www.nj.com/sports/ledger/index.ssf?/base/sports-4/1094706633289150.xml Auto-ref uses a combo of C++ and Java technologies, with both the client and the scoring server being 100% pure java. Currently the system is set up to render Java3D images to pixel boards in the stadium, television broadcast, a handheld device used by the line judge, and the referee's laptop. The system is currently accurate enough to have less than 3 millimeters of error. Mark McKay Alessandro Borges wrote: Where you guys are using Java and 3D engines outside of writing games ? If you're doing something cool, please let me know. That is the question Matthew Schmidt ( [EMAIL PROTECTED] ) from JavaLobby is asking in http://www.javalobby.org/nl/archive/jlnews_20040914o.html If you have something to tell drop him a email. There is also aforum topic about Java3D at JavaLobby: http://www.javalobby.org/thread.jspa?forumID=61threadID=14447 Alessandro === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Dynamic textures
Hi, I'd like to create a piece of geometry with a texture that is dynamically generated based on the (s, t) texture coordinate being read. The intent is to allow me to create a terrain texture which will return a road texture on the bits of terrain that shold have roads, grass in the bits that have grass and rock in the bits that have rock. I can't create a single texture before hand because it would be huge, but I can automatically generate the correct 2D texture using a class I've developed (you can request of this call any rectangular area and it will return the correct 'map' for that section). I've considered using multiple textures, but there seems to be no way for me to integrate my distinct texture maps the way I'd like using a purely 3D process. Another example would be: is there a way to texture a Mandlebrot set on a piece of geometry without prerendering the image of the set? Is there any way to do this? Will the programmable shaders provide this ability when implemented? Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] https://j3d-webstart.dev.java.net/release/java3d-1.3.1.jnlp doesn't work anymore ??
Thierry Milard wrote: I have been trying for a week to play with wjav Web Start jlmn files. It used to work allright. It installed automatically all jar and dll(?) files og java3D version1.3.3 with this tag: extension href=https://j3d-webstart.dev.java.net/release/java3d-1.3.1.jnlp/ But it seems to be out today. Is it still ok to used this tag ? Thierry dev.java.net it down for maintanence today. It should be up and working again tomorrow. Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Bilting to screen Color, Z-Buffer with Rasters
Hi, I need to do some direct writing to the color and z buffer in my 3D application. This needs to be done directly. I've tried using the J3DGraphics2D in the Canvas3D.postRender() method to write a BufferedImage directly to the output buffer, but this has the unfortunate side effect of automatically scaling my image if the screen size changes (I'd much prefer catching the resize event and rebuilding the image I'm bilting). Two things I need to do: - I have an image I'd like to use as a static background and another image with z-buffer information. I'd like to bilt my image and z-buffer first and then draw my 3D scene over top. Can I do this? - I have some images I'd like to bilt directly on top of the final image. Unfortunately, the drawAndFlushImage() method of J3DGraphics2D has the unfortunate 'feature' of automatically scaling my image when the 3D window is resized. What I've tried so far with rasters sometimes allows geometry to project through my raster image. Is there another way to do this? I've been playing with Rasters, which look promising, but haven't been able to get either of my above effects yet. Can the above be done? Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] About posting Java3D job
Hello Meide, I've been working with Java3D for several years now. Previously, I've worked with ITTWorks to produce virtual shoping malls, and am currently working part time with Pantometrics creating simulation software. I would be interested in doing contract work over the internet. I have a webserver, and can create an account where I can post code, demos, and other content you can access securely. Please take a look at my website at http://www.kitfox.com. Could you tell me a little more about this job? Thanks, Mark McKay Meide Zhao wrote: Dear All, I don't know if I can post Java3D job here But it seems that this is the place where experienced Java3D programmer can be found. Thanks, Meide. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
[JAVA3D] Any way to write Z-buffer with raster?
Hi, I'm trying to figure out how to write Z-buffer data. I have a raster that contains both color and depth information. While the color data is being rendered correctly, the depth information seems to be discarded. Is there a way to write both color and depth information? I'd like to be able to draw other objects from my scene graph and have them correctly appear in front or behind objects in my raster. The code below uses a raster with transparency, but I could do it without transparency if necessary. BufferedImage bufImage; bufImage = new BufferedImage(150, 150, BufferedImage.TYPE_4BYTE_ABGR); Graphics2D g = bufImage.createGraphics(); g.setColor(Color.green); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.fillOval(0, 0, 100, 100); g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .5f)); g.setColor(Color.blue); g.fillOval(50, 50, 100, 100); g.dispose(); DepthComponentInt dc = new DepthComponentInt(150, 150); int[] depth = new int[150 * 150]; for (int i = 0; i depth.length; i++) { //As a test, give a large depth value to make raster appear in the back of most scene geometry depth[i] = 10; } dc.setDepthData(depth); ImageComponent2D image; image = new ImageComponent2D(ImageComponent2D.FORMAT_RGBA, bufImage); raster = new javax.media.j3d.Raster(); raster.setPosition(new Point3f(0, 0, 0)); raster.setType(javax.media.j3d.Raster.RASTER_COLOR_DEPTH); raster.setClipMode(javax.media.j3d.Raster.CLIP_IMAGE); raster.setImage(image); raster.setDepthComponent(dc); raster.setSize(bufImage.getWidth(), bufImage.getHeight()); Appearance app = new Appearance(); RenderingAttributes ra = new RenderingAttributes(); ra.setDepthBufferEnable(true); ra.setDepthBufferWriteEnable(true); app.setRenderingAttributes(ra); sceneRoot.addChild(new Shape3D(raster, app)); Mark McKay === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.
Re: [JAVA3D] Any way to write Z-buffer with raster?
Well, Kevin's response seems promising. Quoting form his post: I recommend that you try to use two raster objects, one with RASTER_DEPTH and the other with RASTER_COLOR. Draw the depth raster first. Draw the color-only raster second, with depth test and depth write enable disabled. Draw all 3D objects after this and they should be correctly Z-buffered with the image. I'm going to give this a try. Hopefully it works. Mark McKay Tobias D. Kammann wrote: Hi there. I'm having the same problem. Actually my code looks almost like your code posted one year ago (January 2004). Perhaps we can find a solution together... Take a look at my posting and the answer: http://www.javagaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=3D; action=display;num=1114513672 Unfortunatelly it doesn't work for me that way yet. (The same thing: the Raster has always depthvalue of the 3d point where its origin lies in the scene graph.) Greetings, Tobias aka Konterfei. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message signoff JAVA3D-INTEREST. For general help, send email to [EMAIL PROTECTED] and include in the body of the message help.