Vector3f getNormal(PickIntersection pi, int vertexIndex) { int index;

Vector3f getNormal(PickIntersection pi, int vertexIndex) { int index; Vector3d normal = new Vector3f(); GeometryArray ga = pickIntersection.getGeometryArray(); if (pickIntersection.geometryIsIndexed()) { index = ga.getNormalIndex(vertexIndex); } else { index = vertexIndex; } ga.getNormal(index, normal); return normal; } The color, normal, and texture coordinate information for the intersected primitive and the intersection point can be queryed. The geometry includes them, and the corresponding READcapability bits are set. PickTool.setCapabilities(Node, int)can be used to set the capability bits to allow this data to be queryed. 16.6 PickResult java.lang.Object | +–com.sun.j3d.utils.picking.PickResult PickResultstores information about a pick hit. Detailed information about the pick and each intersection of the PickShapewith the picked Nodecan be inquired. The PickResultis constructed with basic information, and more detailed information is generated as needed. The additional information is only available if capability bits on the scenegraph Nodesare set properly; PickTool.setCapabilities(Node, int)can be used to ensure correct capabilities are set. Inquiring data that is not available due to capabilities not being set will generate a CapabilityNotSetException. A PickResultcan be used to calculate intersections on Nodewhich is not part of a live scenegraph using the constructor which takes a local to VWorldtransformation for the Node. Pick hits on TriangleStripprimitives will store the triangle points in the PickIntersectionwith the vertices in counterclockwise order. For triangles that start with an odd numbered vertex, this will be the opposite of the order of the points in the TriangleStrip. This way the triangle in the PickIntersectionwill be displayed the same way as the triangle in the strip. If the Shape3Dbeing picked has multiple geometry arrays, the arrays are stored in the PickResultand referred to by a geometry index. If the Shape3Drefers to a CompressedGeometry, the geometry is decompressed into an array of Shape3Dnodes that can be queryed. The geometry NodeComponentsfor the Shape3Dnodes are stored and used as if the Shape3Dhad multiple geometries. If there are multiple CompressedGeometrieson the Shape3D, the decompressed Shape3Dsand GeometryArrayswill be stored sequentially. The intersection point for Morphnodes cannot be calculated using the displayed geometry due to limitations in the current Java3D core API (the current geometry of the Morphcannot be inquired). Instead, the geometry at index 0 in the Morphis used. This limitation may be eliminated in a future release of Java3D. 270
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Leave a Reply