Hi again,
there's another problem I got with geometry-picking.... I load geometry from an OBJ-File (some polygones...) after the BranchGroup is filled up with the data from the file I'm doing this: public BranchGroup getLoadedFile(){ BranchGroup sceneRoot = new BranchGroup(); TransformGroup szeneScale = new TransformGroup(); sceneRoot.addChild(szeneScale); TransformGroup szeneTrans = new TransformGroup(); szeneScale.addChild(szeneTrans); //for all above read and write caps are set...
...load the obj-file...
Enumeration e=loadedBG.getAllChildren(); setS3dCaps(e); szeneTrans.addChild(loadedBG); return sceneRoot; }
public void setS3dCaps(Enumeration e){ while(e.hasMoreElements()){ Object o = e.nextElement(); if (o instanceof Shape3D){ Shape3D S = (Shape3D) o; S.setCapability(Geometry.ALLOW_INTERSECT); } if (o instanceof Group) { Group g = (Group) o; g.setCapability(Group.ALLOW_CHILDREN_WRITE); //could not be needed ? g.setCapability(Group.ALLOW_CHILDREN_READ); //could not be needed ? g.setCapability(Geometry.ALLOW_INTERSECT); this.setS3dCaps(g.getAllChildren()); } } } OK, then I add the loaded BG into my BranchGraph as a child of a BranchGroup which has also my PickiningBehavior as a child. The PickingBehavior know the "loaded BG" since the construction, where pickCanvas.setMode(PickTool.GEOMETRY); is set.
when I click to the Geometry the capabilityNotSet Error hit me, that Shape3D has no Capability of "allow intersect" but would not be recognized....
if I generate some Text3D objects and gave them txt3d.setCapability(Geometry.ALLOW_INTERSECT); and construct the PickingBehavior with the parent-BranchGroup of the text3D instead of BG which is the loadedBG all is working fine without any errors.....
has anybody an idea in how to solve this???
also I didn't solve the problem with mipmapping just shorten the code to: private Texture[] makeTexture(Image[] img, int groesse){
TextureLoader texloader=null; Texture[] textures=new Texture[img.length];
for(int i=0;i<img.length;i++){ BufferedImage BUF = new BufferedImage(groesse,groesse,BufferedImage.TYPE_INT_ARGB); Graphics g = BUF.getGraphics(); g.drawImage (img[i],0,0,new JLabel()); texloader = new TextureLoader(BUF, TextureLoader.GENERATE_MIPMAP); textures[i]=texloader.getTexture(); } return textures; }
sad but true with the identical results...nothing is detectable...so if anybody find any weirdness in this code please let me know....
best regards rolf
-- Rolf Gabler-Mieck c/o LGI-Geographisches Institut der CAU-Kiel Ludewig-Meyen Str. 14 24098 Kiel Tel: +49 431-880.2955 FAX: +49 431-880.4658 e-mail: [EMAIL PROTECTED]
=========================================================================== 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".