├── .gitignore ├── COPYRIGHT.txt ├── LICENSE-SPEC.html ├── LICENSE.txt ├── README.md ├── doc-files ├── Behaviors.html ├── Behaviors1.gif ├── Behaviors2.gif ├── Behaviors3.gif ├── Behaviors4.gif ├── Behaviors5.gif ├── Behaviors6.gif ├── Behaviors7.gif ├── Behaviors8.gif ├── Concepts.html ├── Concepts1.gif ├── Concepts2.gif ├── DAG.gif ├── HelloUniverse.html ├── Immediate.html ├── Immediate1.gif ├── Rendering.html ├── SceneGraphOverview.html ├── SceneGraphSharing.html ├── SceneGraphSharing1.gif ├── SceneGraphSharing2.gif ├── SceneGraphSharing3.gif ├── SceneGraphSharing4.gif ├── SceneGraphSharing5.gif ├── ViewBranch.gif ├── ViewModel.html ├── ViewModel1.gif ├── ViewModel10.gif ├── ViewModel11.gif ├── ViewModel12.gif ├── ViewModel13.gif ├── ViewModel14.gif ├── ViewModel2.gif ├── ViewModel3.gif ├── ViewModel4.gif ├── ViewModel5.gif ├── ViewModel6.gif ├── ViewModel7.gif ├── ViewModel8.gif ├── ViewModel9.gif ├── VirtualUniverse.gif ├── VirtualUniverse.html ├── intro.gif └── intro.html ├── docs ├── ChangeLog-1_4.html ├── ChangeLog-1_5.html ├── GL2ES2PipelineUsageGuide.md ├── api-changes-1_4.txt ├── api-changes-1_5.txt ├── api-changes-1_6.txt ├── api-changes-1_7.txt ├── perf_guide.txt └── tutorial │ ├── j3d_tutorial_ch0.pdf │ ├── j3d_tutorial_ch1.pdf │ ├── j3d_tutorial_ch2.pdf │ ├── j3d_tutorial_ch3.pdf │ ├── j3d_tutorial_ch4.pdf │ ├── j3d_tutorial_ch5.pdf │ ├── j3d_tutorial_ch6.pdf │ └── j3d_tutorial_ch7.pdf ├── pom.xml └── src └── main ├── java-templates └── org │ └── jogamp │ └── java3d │ └── VersionInfo.java ├── java └── org │ └── jogamp │ └── java3d │ ├── Alpha.java │ ├── AlternateAppearance.java │ ├── AlternateAppearanceRetained.java │ ├── AmbientLight.java │ ├── AmbientLightRetained.java │ ├── Appearance.java │ ├── AppearanceRetained.java │ ├── AssertionFailureException.java │ ├── AttributeBin.java │ ├── AudioDevice.java │ ├── AudioDevice3D.java │ ├── AudioDevice3DL2.java │ ├── AudioDeviceEnumerator.java │ ├── AuralAttributes.java │ ├── AuralAttributesRetained.java │ ├── AutoOffScreenCanvas3D.java │ ├── BHInsertStructure.java │ ├── BHInternalNode.java │ ├── BHLeafInterface.java │ ├── BHLeafNode.java │ ├── BHNode.java │ ├── BHTree.java │ ├── Background.java │ ├── BackgroundRetained.java │ ├── BackgroundSound.java │ ├── BackgroundSoundRetained.java │ ├── BadTransformException.java │ ├── Behavior.java │ ├── BehaviorRetained.java │ ├── BehaviorScheduler.java │ ├── BehaviorStructure.java │ ├── Billboard.java │ ├── BoundingBox.java │ ├── BoundingLeaf.java │ ├── BoundingLeafRetained.java │ ├── BoundingPolytope.java │ ├── BoundingSphere.java │ ├── Bounds.java │ ├── BranchGroup.java │ ├── BranchGroupRetained.java │ ├── CachedFrustum.java │ ├── CachedTargets.java │ ├── Canvas3D.java │ ├── CanvasViewCache.java │ ├── CanvasViewEventCatcher.java │ ├── CapabilityBits.java │ ├── CapabilityNotSetException.java │ ├── Clip.java │ ├── ClipRetained.java │ ├── ColorInterpolator.java │ ├── ColoringAttributes.java │ ├── ColoringAttributesRetained.java │ ├── CompileState.java │ ├── CompressedGeometry.java │ ├── CompressedGeometryHeader.java │ ├── CompressedGeometryRenderMethod.java │ ├── CompressedGeometryRetained.java │ ├── ConeSound.java │ ├── ConeSoundRetained.java │ ├── Context.java │ ├── DanglingReferenceException.java │ ├── DecalGroup.java │ ├── DecalGroupRetained.java │ ├── DefaultRenderMethod.java │ ├── DepthComponent.java │ ├── DepthComponentFloat.java │ ├── DepthComponentFloatRetained.java │ ├── DepthComponentInt.java │ ├── DepthComponentIntRetained.java │ ├── DepthComponentNative.java │ ├── DepthComponentNativeRetained.java │ ├── DepthComponentRetained.java │ ├── DirectionalLight.java │ ├── DirectionalLightRetained.java │ ├── DisplayListRenderMethod.java │ ├── DistanceLOD.java │ ├── Drawable.java │ ├── DrawingSurfaceObject.java │ ├── EnvironmentSet.java │ ├── EventCatcher.java │ ├── ExponentialFog.java │ ├── ExponentialFogRetained.java │ ├── Fog.java │ ├── FogRetained.java │ ├── Font3D.java │ ├── FontExtrusion.java │ ├── FreeListManager.java │ ├── GLSLShaderProgram.java │ ├── GLSLShaderProgramRetained.java │ ├── GeneralizedStrip.java │ ├── GeneralizedStripFlags.java │ ├── GeneralizedVertexList.java │ ├── Geometry.java │ ├── GeometryArray.java │ ├── GeometryArrayRetained.java │ ├── GeometryAtom.java │ ├── GeometryDecompressor.java │ ├── GeometryDecompressorRetained.java │ ├── GeometryDecompressorShape3D.java │ ├── GeometryLock.java │ ├── GeometryRetained.java │ ├── GeometryService.java │ ├── GeometryStripArray.java │ ├── GeometryStripArrayRetained.java │ ├── GeometryStructure.java │ ├── GeometryUpdater.java │ ├── GraphStructureChangeListener.java │ ├── GraphicsConfigInfo.java │ ├── GraphicsConfigTemplate3D.java │ ├── GraphicsContext3D.java │ ├── Group.java │ ├── GroupRetained.java │ ├── HashKey.java │ ├── HiResCoord.java │ ├── IllegalRenderingStateException.java │ ├── IllegalSceneGraphException.java │ ├── IllegalSharingException.java │ ├── ImageComponent.java │ ├── ImageComponent2D.java │ ├── ImageComponent2DRetained.java │ ├── ImageComponent3D.java │ ├── ImageComponent3DRetained.java │ ├── ImageComponentRetained.java │ ├── ImageComponentUpdateInfo.java │ ├── IndexedGeometryArray.java │ ├── IndexedGeometryArrayRetained.java │ ├── IndexedGeometryStripArray.java │ ├── IndexedGeometryStripArrayRetained.java │ ├── IndexedLineArray.java │ ├── IndexedLineArrayRetained.java │ ├── IndexedLineStripArray.java │ ├── IndexedLineStripArrayRetained.java │ ├── IndexedObject.java │ ├── IndexedPointArray.java │ ├── IndexedPointArrayRetained.java │ ├── IndexedQuadArray.java │ ├── IndexedQuadArrayRetained.java │ ├── IndexedTriangleArray.java │ ├── IndexedTriangleArrayRetained.java │ ├── IndexedTriangleFanArray.java │ ├── IndexedTriangleFanArrayRetained.java │ ├── IndexedTriangleStripArray.java │ ├── IndexedTriangleStripArrayRetained.java │ ├── IndexedUnorderSet.java │ ├── InputDevice.java │ ├── InputDeviceBlockingThread.java │ ├── InputDeviceScheduler.java │ ├── IntegerFreeList.java │ ├── Interpolator.java │ ├── J3DBuffer.java │ ├── J3DGraphics2D.java │ ├── J3DGraphics2DImpl.java │ ├── J3dClock.java │ ├── J3dDebug.java │ ├── J3dHash.java │ ├── J3dI18N.java │ ├── J3dMessage.java │ ├── J3dNotification.java │ ├── J3dQueryProps.java │ ├── J3dStructure.java │ ├── J3dThread.java │ ├── J3dThreadData.java │ ├── Jogl2es2Context.java │ ├── Jogl2es2DEPPipeline.java │ ├── Jogl2es2MatrixUtil.java │ ├── Jogl2es2PerFrameStats.java │ ├── Jogl2es2Pipeline.java │ ├── JoglContext.java │ ├── JoglDrawable.java │ ├── JoglDrawingSurfaceObject.java │ ├── JoglGraphicsConfiguration.java │ ├── JoglPipeline.java │ ├── JoglShaderObject.java │ ├── LOD.java │ ├── Leaf.java │ ├── LeafRetained.java │ ├── Light.java │ ├── LightBin.java │ ├── LightRetained.java │ ├── LightSet.java │ ├── LineArray.java │ ├── LineArrayRetained.java │ ├── LineAttributes.java │ ├── LineAttributesRetained.java │ ├── LineStripArray.java │ ├── LineStripArrayRetained.java │ ├── LinearFog.java │ ├── LinearFogRetained.java │ ├── Link.java │ ├── LinkRetained.java │ ├── Locale.java │ ├── MRSWLock.java │ ├── MasterControl.java │ ├── MasterControlThread.java │ ├── Material.java │ ├── MaterialRetained.java │ ├── MediaContainer.java │ ├── MediaContainerRetained.java │ ├── MemoryFreeList.java │ ├── ModelClip.java │ ├── ModelClipRetained.java │ ├── Morph.java │ ├── MorphRetained.java │ ├── MultipleParentException.java │ ├── NioImageBuffer.java │ ├── NnuId.java │ ├── NnuIdManager.java │ ├── Node.java │ ├── NodeComponent.java │ ├── NodeComponentRetained.java │ ├── NodeComponentUpdate.java │ ├── NodeData.java │ ├── NodeReferenceTable.java │ ├── NodeRetained.java │ ├── NoopDrawingSurfaceObject.java │ ├── NoopPipeline.java │ ├── NotificationThread.java │ ├── ObjectUpdate.java │ ├── OrderedBin.java │ ├── OrderedChildInfo.java │ ├── OrderedCollection.java │ ├── OrderedGroup.java │ ├── OrderedGroupRetained.java │ ├── OrderedPath.java │ ├── OrderedPathElement.java │ ├── OrientedShape3D.java │ ├── OrientedShape3DRenderMethod.java │ ├── OrientedShape3DRetained.java │ ├── PathInterpolator.java │ ├── PhysicalBody.java │ ├── PhysicalEnvironment.java │ ├── PickBounds.java │ ├── PickCone.java │ ├── PickConeRay.java │ ├── PickConeSegment.java │ ├── PickCylinder.java │ ├── PickCylinderRay.java │ ├── PickCylinderSegment.java │ ├── PickInfo.java │ ├── PickPoint.java │ ├── PickRay.java │ ├── PickSegment.java │ ├── PickShape.java │ ├── Pipeline.java │ ├── PointArray.java │ ├── PointArrayRetained.java │ ├── PointAttributes.java │ ├── PointAttributesRetained.java │ ├── PointLight.java │ ├── PointLightRetained.java │ ├── PointSound.java │ ├── PointSoundRetained.java │ ├── PolygonAttributes.java │ ├── PolygonAttributesRetained.java │ ├── PositionInterpolator.java │ ├── PositionPathInterpolator.java │ ├── QuadArray.java │ ├── QuadArrayRetained.java │ ├── Raster.java │ ├── RasterRetained.java │ ├── RenderAtom.java │ ├── RenderAtomListInfo.java │ ├── RenderBin.java │ ├── RenderMethod.java │ ├── RenderMolecule.java │ ├── Renderer.java │ ├── RendererStructure.java │ ├── RenderingAttributes.java │ ├── RenderingAttributesRetained.java │ ├── RenderingAttributesStructure.java │ ├── RenderingEnvironmentStructure.java │ ├── RenderingError.java │ ├── RenderingErrorListener.java │ ├── RestrictedAccessException.java │ ├── RotPosPathInterpolator.java │ ├── RotPosScalePathInterpolator.java │ ├── RotationInterpolator.java │ ├── RotationPathInterpolator.java │ ├── ScaleInterpolator.java │ ├── SceneGraphCycleException.java │ ├── SceneGraphObject.java │ ├── SceneGraphObjectRetained.java │ ├── SceneGraphPath.java │ ├── Screen3D.java │ ├── ScreenViewCache.java │ ├── Sensor.java │ ├── SensorRead.java │ ├── SetLiveState.java │ ├── Shader.java │ ├── ShaderAppearance.java │ ├── ShaderAppearanceRetained.java │ ├── ShaderAttrLoc.java │ ├── ShaderAttribute.java │ ├── ShaderAttributeArray.java │ ├── ShaderAttributeArrayRetained.java │ ├── ShaderAttributeBinding.java │ ├── ShaderAttributeBindingRetained.java │ ├── ShaderAttributeObject.java │ ├── ShaderAttributeObjectRetained.java │ ├── ShaderAttributeRetained.java │ ├── ShaderAttributeSet.java │ ├── ShaderAttributeSetRetained.java │ ├── ShaderAttributeValue.java │ ├── ShaderAttributeValueRetained.java │ ├── ShaderBin.java │ ├── ShaderConstants.java │ ├── ShaderError.java │ ├── ShaderErrorListener.java │ ├── ShaderId.java │ ├── ShaderProgram.java │ ├── ShaderProgramId.java │ ├── ShaderProgramRetained.java │ ├── ShaderRetained.java │ ├── Shape3D.java │ ├── Shape3DCompileRetained.java │ ├── Shape3DRetained.java │ ├── SharedGroup.java │ ├── SharedGroupRetained.java │ ├── Sound.java │ ├── SoundException.java │ ├── SoundRetained.java │ ├── SoundScheduler.java │ ├── SoundSchedulerAtom.java │ ├── SoundStructure.java │ ├── Soundscape.java │ ├── SoundscapeRetained.java │ ├── SourceCodeShader.java │ ├── SourceCodeShaderRetained.java │ ├── SparseArray.java │ ├── SpotLight.java │ ├── SpotLightRetained.java │ ├── StructureUpdateThread.java │ ├── Switch.java │ ├── SwitchRetained.java │ ├── SwitchState.java │ ├── SwitchValueInterpolator.java │ ├── Targets.java │ ├── TargetsInterface.java │ ├── TexCoordGeneration.java │ ├── TexCoordGenerationRetained.java │ ├── Text3D.java │ ├── Text3DRenderMethod.java │ ├── Text3DRetained.java │ ├── Texture.java │ ├── Texture2D.java │ ├── Texture2DRetained.java │ ├── Texture3D.java │ ├── Texture3DRetained.java │ ├── TextureAttributes.java │ ├── TextureAttributesRetained.java │ ├── TextureBin.java │ ├── TextureCubeMap.java │ ├── TextureCubeMapRetained.java │ ├── TextureRetained.java │ ├── TextureUnitState.java │ ├── TextureUnitStateRetained.java │ ├── TimerThread.java │ ├── Transform3D.java │ ├── TransformGroup.java │ ├── TransformGroupData.java │ ├── TransformGroupRetained.java │ ├── TransformInterpolator.java │ ├── TransformStructure.java │ ├── TransparencyAttributes.java │ ├── TransparencyAttributesRetained.java │ ├── TransparencyInterpolator.java │ ├── TransparencySortGeom.java │ ├── TransparencySortMap.java │ ├── TransparentRenderingInfo.java │ ├── TriangleArray.java │ ├── TriangleArrayRetained.java │ ├── TriangleFanArray.java │ ├── TriangleFanArrayRetained.java │ ├── TriangleStripArray.java │ ├── TriangleStripArrayRetained.java │ ├── UnorderList.java │ ├── UpdateTargets.java │ ├── Utils.java │ ├── VertexArrayRenderMethod.java │ ├── View.java │ ├── ViewCache.java │ ├── ViewPlatform.java │ ├── ViewPlatformRetained.java │ ├── ViewSpecificGroup.java │ ├── ViewSpecificGroupRetained.java │ ├── VirtualUniverse.java │ ├── WakeupAnd.java │ ├── WakeupAndOfOrs.java │ ├── WakeupCondition.java │ ├── WakeupCriteriaEnumerator.java │ ├── WakeupCriterion.java │ ├── WakeupIndexedList.java │ ├── WakeupOnAWTEvent.java │ ├── WakeupOnActivation.java │ ├── WakeupOnBehaviorPost.java │ ├── WakeupOnCollisionEntry.java │ ├── WakeupOnCollisionExit.java │ ├── WakeupOnCollisionMovement.java │ ├── WakeupOnDeactivation.java │ ├── WakeupOnElapsedFrames.java │ ├── WakeupOnElapsedTime.java │ ├── WakeupOnElapsedTimeHeap.java │ ├── WakeupOnSensorEntry.java │ ├── WakeupOnSensorExit.java │ ├── WakeupOnTransformChange.java │ ├── WakeupOnViewPlatformEntry.java │ ├── WakeupOnViewPlatformExit.java │ ├── WakeupOr.java │ └── WakeupOrOfAnds.java ├── javadoc └── org │ └── jogamp │ └── java3d │ ├── doc-files │ ├── Behaviors.html │ ├── Behaviors1.gif │ ├── Behaviors2.gif │ ├── Behaviors3.gif │ ├── Behaviors4.gif │ ├── Behaviors5.gif │ ├── Behaviors6.gif │ ├── Behaviors7.gif │ ├── Behaviors8.gif │ ├── Concepts.html │ ├── Concepts1.gif │ ├── Concepts2.gif │ ├── DAG.gif │ ├── HelloUniverse.html │ ├── Immediate.html │ ├── Immediate1.gif │ ├── Rendering.html │ ├── SceneGraphOverview.html │ ├── SceneGraphSharing.html │ ├── SceneGraphSharing1.gif │ ├── SceneGraphSharing2.gif │ ├── SceneGraphSharing3.gif │ ├── SceneGraphSharing4.gif │ ├── SceneGraphSharing5.gif │ ├── ViewBranch.gif │ ├── ViewModel.html │ ├── ViewModel1.gif │ ├── ViewModel10.gif │ ├── ViewModel11.gif │ ├── ViewModel12.gif │ ├── ViewModel13.gif │ ├── ViewModel14.gif │ ├── ViewModel2.gif │ ├── ViewModel3.gif │ ├── ViewModel4.gif │ ├── ViewModel5.gif │ ├── ViewModel6.gif │ ├── ViewModel7.gif │ ├── ViewModel8.gif │ ├── ViewModel9.gif │ ├── VirtualUniverse.gif │ ├── VirtualUniverse.html │ ├── intro.gif │ └── intro.html │ └── package.html └── resources └── org └── jogamp └── java3d └── ExceptionStrings.properties /.gitignore: -------------------------------------------------------------------------------- 1 | /.classpath 2 | /.project 3 | /.settings/ 4 | /target/ 5 | /doc/ 6 | /doc-all/ 7 | -------------------------------------------------------------------------------- /COPYRIGHT.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/COPYRIGHT.txt -------------------------------------------------------------------------------- /LICENSE-SPEC.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 6 |Copyright 1996-2008 Sun Microsystems, Inc. All rights reserved. 10 | Use is subject to license terms. 11 |
12 |This javadoc-generated API documentation is not an 13 | official API specification. This documentation may contain references to 14 | Java and Java 3D, both of which are trademarks of Sun Microsystems, Inc. 15 | Any reference to these and other trademarks of Sun Microsystems are 16 | for explanatory purposes only. Their use does impart any rights beyond 17 | those listed in the source code license. In particular, Sun Microsystems 18 | retains all intellectual property and trademark rights as described in 19 | the proprietary rights notice in the COPYRIGHT.txt file. 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Java3D Readme 2 | === 3 | The source code for the j3d-core project is copyrighted code that is 4 | licensed to individuals or companies who download or otherwise access 5 | the code. 6 | 7 | The copyright notice for this project is in COPYRIGHT.txt 8 | 9 | The source code license information for this project is in LICENSE.txt 10 | 11 | Additional information and license restrictions for third party source 12 | code are found in the THIRDPARTY-LICENSE-*.txt files. 13 | 14 | ## Building Java3D 15 | 16 | The instructions below are based on eclipse, however they should work on most common IDE's 17 | 18 | Clone the repo using 19 | https://github.com/philjord/java3d-core.git 20 | Make note of the root folder you use 21 | Right click on the Project Explorer view and select Import 22 | Expand the Maven group and select Existing Maven Project and click Next 23 | For Root directory click Browse and find the root folder that you cloned the repo into 24 | There should be a pom.xml that is ticked in the Projects area 25 | Click Finish 26 | Repeat for java3d-utils using 27 | https://github.com/philjord/java3d-utils.git 28 | Repeat for vecmath using 29 | https://github.com/philjord/vecmath.git 30 | 31 | Once that's done it's likely you'll need to 32 | Right click on pom.xml -> Run As -> Maven clean 33 | then 34 | Right click on pom.xml -> Run As -> Maven generate sources 35 | This should place a derived version of VersionInfo.java into /java3d-core/target/generated-sources/java-templates 36 | 37 | 38 | If you are new to Java3D then it might be good to repeat the clone import step for java3d-examples too, using 39 | https://github.com/philjord/java3d-examples.git 40 | 41 | Now if you right click on 42 | org.jdesktop.j3d.examples.hello_universe.HelloUniverse.java 43 | Run as ... Java Application 44 | You should see Java3D working 45 | 46 | ## Documentation 47 | 48 | ### Javadocs 49 | 50 | https://jogamp.org/wiki/index.php?title=Java3D_API_Documentation 51 | 52 | ### Basic overview guide 53 | 54 | For the best kick off point see [/docs/tutorial/](/docs/tutorial/) 55 | For a description of performance see [/docs/perf_guide.txt](/docs/perf_guide.txt) 56 | Old Java3d project site with lots of informationHere are code fragments from a simple program, HelloUniverse.java
,
12 | that creates a cube and a RotationInterpolator behavior object that
13 | rotates the cube at a constant rate of pi/2 radians per second. The
14 | HelloUniverse class creates the branch graph
15 | that includes the cube and the RotationInterpolator behavior. It then
16 | adds this branch graph to the Locale object generated by the
17 | SimpleUniverse utility.
18 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /doc-files/Immediate1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/Immediate1.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing1.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing2.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing3.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing4.gif -------------------------------------------------------------------------------- /doc-files/SceneGraphSharing5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/SceneGraphSharing5.gif -------------------------------------------------------------------------------- /doc-files/ViewBranch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewBranch.gif -------------------------------------------------------------------------------- /doc-files/ViewModel1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel1.gif -------------------------------------------------------------------------------- /doc-files/ViewModel10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel10.gif -------------------------------------------------------------------------------- /doc-files/ViewModel11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel11.gif -------------------------------------------------------------------------------- /doc-files/ViewModel12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel12.gif -------------------------------------------------------------------------------- /doc-files/ViewModel13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel13.gif -------------------------------------------------------------------------------- /doc-files/ViewModel14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel14.gif -------------------------------------------------------------------------------- /doc-files/ViewModel2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel2.gif -------------------------------------------------------------------------------- /doc-files/ViewModel3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel3.gif -------------------------------------------------------------------------------- /doc-files/ViewModel4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel4.gif -------------------------------------------------------------------------------- /doc-files/ViewModel5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel5.gif -------------------------------------------------------------------------------- /doc-files/ViewModel6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel6.gif -------------------------------------------------------------------------------- /doc-files/ViewModel7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel7.gif -------------------------------------------------------------------------------- /doc-files/ViewModel8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel8.gif -------------------------------------------------------------------------------- /doc-files/ViewModel9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/ViewModel9.gif -------------------------------------------------------------------------------- /doc-files/VirtualUniverse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/VirtualUniverse.gif -------------------------------------------------------------------------------- /doc-files/intro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/doc-files/intro.gif -------------------------------------------------------------------------------- /docs/api-changes-1_6.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------ 2 | $RCSfile$ 3 | $Revision$ 4 | $Date$ 5 | ------------------------------------------------------------------------ 6 | This document conatains proposed API changes to the Java 3D 1.6 API 7 | that deviate from the 1.5 API. 8 | 9 | This file must be updated to record the addition or deprecation of any 10 | public or protected class, interface, field, constructor, or method to 11 | the Java 3D API. 12 | 13 | The one exception to this rule is that you don't need to update this 14 | file when adding a non-final (i.e., virtual) method to a class if that 15 | method--with exactly the same signature--already exists in a 16 | superclass. For example, adding a "toString" method to a j3d object 17 | doesn't require an entry in this file. Likewise, adding duplicateNode 18 | or cloneNode methods to Node subclasses doesn't require an entry in 19 | this file. 20 | 21 | No incompatible changes to the Java 3D 1.5 API are allowed. 22 | 23 | 24 | I. New/deprecated fields, constructors, methods 25 | 26 |
public class HelloUniverse ... {
public BranchGroup createSceneGraph() {
// Create the root of the branch graph
BranchGroup objRoot = new BranchGroup();
// Create the TransformGroup node and initialize it to the
// identity. Enable the TRANSFORM_WRITE capability so that
// our behavior code can modify it at run time. Add it to
// the root of the subgraph.
TransformGroup objTrans = new TransformGroup();
objTrans.setCapability(
TransformGroup.ALLOW_TRANSFORM_WRITE);
objRoot.addChild(objTrans);
// Create a simple Shape3D node; add it to the scene graph.
objTrans.addChild(new ColorCube(0.4));
// Create a new Behavior object that will perform the
// desired operation on the specified transform and add
// it into the scene graph.
Transform3D yAxis = new Transform3D();
Alpha rotationAlpha = new Alpha(-1, 4000);
RotationInterpolator rotator = new RotationInterpolator(
rotationAlpha, objTrans, yAxis,
0.0f, (float) Math.PI*2.0f);
BoundingSphere bounds =
new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
rotator.setSchedulingBounds(bounds);
objRoot.addChild(rotator);
// Have Java 3D perform optimizations on this scene graph.
objRoot.compile();
return objRoot;
}
public HelloUniverse() {
<set layout of container, construct canvas3d, add canvas3d>
// Create the scene; attach it to the virtual universe
BranchGroup scene = createSceneGraph();
SimpleUniverse u = new SimpleUniverse(canvas3d);
u.getViewingPlatform().setNominalViewingTransform();
u.addBranchGraph(scene);
}
}
cloneTree
call an updated reference was requested
31 | * for a node that did not get cloned. This happens when a sub-graph is
32 | * duplicated via cloneTree
and has at least one Leaf node
33 | * that contains a reference to a Node that has no corresponding node in
34 | * the cloned sub-graph. This results in two Leaf nodes wanting to share
35 | * access to the same Node.
36 | *
37 | * If dangling references are to be allowed during the cloneTree call,
38 | * cloneTree
should be called with the
39 | * allowDanglingReferences
parameter set to true
.
40 | * @see Node#cloneTree
41 | */
42 | public class DanglingReferenceException extends RuntimeException {
43 |
44 | /**
45 | * Create the exception object with default values.
46 | */
47 | public DanglingReferenceException() {
48 | }
49 |
50 | /**
51 | * Create the exception object that outputs message.
52 | * @param str the message string to be output.
53 | */
54 | public DanglingReferenceException(String str) {
55 | super(str);
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/DecalGroupRetained.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | class DecalGroupRetained extends OrderedGroupRetained {
30 |
31 | DecalGroupRetained() {
32 | this.nodeType = NodeRetained.DECALGROUP;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/DefaultRenderMethod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * The RenderMethod interface is used to create various ways to render
31 | * different geometries.
32 | */
33 |
34 | class DefaultRenderMethod implements RenderMethod {
35 | /**
36 | * The actual rendering code for this RenderMethod
37 | */
38 | @Override
39 | public boolean render(RenderMolecule rm, Canvas3D cv,
40 | RenderAtomListInfo ra, int dirtyBits) {
41 |
42 | boolean isVisible = false; // True if any of the RAs is visible.
43 |
44 | while (ra != null) {
45 | if (cv.ra == ra.renderAtom) {
46 | if (cv.raIsVisible) {
47 | cv.updateState(dirtyBits);
48 | ra.geometry().execute(cv, ra.renderAtom,
49 | rm.isNonUniformScale,
50 | rm.useAlpha, rm.alpha,
51 | cv.screen.screen,
52 | rm.textureBin.attributeBin.
53 | ignoreVertexColors);
54 | isVisible = true;
55 | }
56 | }
57 | else {
58 | if (!VirtualUniverse.mc.viewFrustumCulling ||
59 | ra.renderAtom.localeVwcBounds.intersect(cv.viewFrustum)) {
60 | cv.raIsVisible = true;
61 | cv.updateState(dirtyBits);
62 | ra.geometry().execute(cv, ra.renderAtom, rm.isNonUniformScale,
63 | rm.useAlpha, rm.alpha,
64 | cv.screen.screen,
65 | rm.textureBin.attributeBin.
66 | ignoreVertexColors);
67 | isVisible = true;
68 | }
69 | else {
70 | cv.raIsVisible = false;
71 | }
72 | cv.ra = ra.renderAtom;
73 | }
74 | ra = ra.next;
75 | }
76 |
77 | return isVisible;
78 |
79 | }
80 |
81 |
82 |
83 | }
84 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/DepthComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * Abstract base class that defines a 2D array of depth (Z) values.
31 | */
32 |
33 | public abstract class DepthComponent extends NodeComponent {
34 | /**
35 | * Specifies that this DepthComponent object allows reading its
36 | * size component information (width and height).
37 | */
38 | public static final int
39 | ALLOW_SIZE_READ = CapabilityBits.DEPTH_COMPONENT_ALLOW_SIZE_READ;
40 |
41 | /**
42 | * Specifies that this DepthComponent object allows reading its
43 | * depth data component information.
44 | */
45 | public static final int
46 | ALLOW_DATA_READ = CapabilityBits.DEPTH_COMPONENT_ALLOW_DATA_READ;
47 |
48 | // Array for setting default read capabilities
49 | private static final int[] readCapabilities = {
50 | ALLOW_SIZE_READ,
51 | ALLOW_DATA_READ
52 | };
53 |
54 | /**
55 | * default constructor
56 | */
57 | DepthComponent() {
58 | // set default read capabilities
59 | setDefaultReadCapabilities(readCapabilities);
60 | }
61 |
62 | /**
63 | * Retrieves the width of this depth component object.
64 | * @return the width of the array of depth values
65 | * @exception CapabilityNotSetException if appropriate capability is
66 | * not set and this object is part of live or compiled scene graph
67 | */
68 | public int getWidth() {
69 | if (isLiveOrCompiled())
70 | if (!this.getCapability(ALLOW_SIZE_READ))
71 | throw new CapabilityNotSetException(J3dI18N.getString("DepthComponent0"));
72 | return ((DepthComponentRetained)this.retained).getWidth();
73 | }
74 |
75 | /**
76 | * Retrieves the height of this depth component object.
77 | * @return the height of the array of depth values
78 | * @exception CapabilityNotSetException if appropriate capability is
79 | * not set and this object is part of live or compiled scene graph
80 | */
81 | public int getHeight() {
82 | if (isLiveOrCompiled())
83 | if (!this.getCapability(ALLOW_SIZE_READ))
84 | throw new CapabilityNotSetException(J3dI18N.getString("DepthComponent0"));
85 | return ((DepthComponentRetained)this.retained).getHeight();
86 | }
87 |
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/DepthComponentFloatRetained.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 |
30 | /**
31 | * A 2D array of depth (Z) values in floating point format in the range [0,1].
32 | * A value of 0.0 indicates the closest Z value to the user while a value of
33 | * 1.0 indicates the farthest Z value.
34 | */
35 |
36 | class DepthComponentFloatRetained extends DepthComponentRetained {
37 | float depthData[];
38 |
39 | /**
40 | * Constructs a new floating-point depth (z-buffer) component object with
41 | * the specified width and height.
42 | * @param width the width of the array of depth values
43 | * @param height the height of the array of depth values
44 | */
45 | void initialize(int width, int height) {
46 | type = DEPTH_COMPONENT_TYPE_FLOAT;
47 | depthData = new float[width * height];
48 | this.width = width;
49 | this.height = height;
50 | }
51 |
52 | /**
53 | * Copies the specified depth data to this object.
54 | * @param depthData array of floats containing the depth data
55 | */
56 | void setDepthData(float[] depthData) {
57 | int i;
58 | for (i = 0; i < depthData.length; i++)
59 | this.depthData[i] = depthData[i];
60 | }
61 |
62 |
63 | /**
64 | * Copies the depth data from this object to the specified array.
65 | * @param depthData array of floats that will receive a copy of
66 | * the depth data
67 | */
68 | void getDepthData(float[] depthData) {
69 | int i;
70 | for (i = 0; i < this.depthData.length; i++)
71 | depthData[i] = this.depthData[i];
72 | }
73 |
74 | /*
75 | * retrieve depth data from input buffer
76 | */
77 | final void retrieveDepth(float[] buf, int wRead, int hRead) {
78 | int srcOffset, dstOffset, i;
79 |
80 | // Yup -> Ydown
81 | for (srcOffset = (hRead - 1) * wRead, dstOffset = 0,
82 | i = 0; i < hRead; i++,
83 | srcOffset -= wRead, dstOffset += width) {
84 |
85 | System.arraycopy(buf, srcOffset, depthData, dstOffset, wRead);
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/DepthComponentIntRetained.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 |
30 | /**
31 | * A 2D array of depth (Z) values in integer format. Values are in the
32 | * range [0,(2**N)-1], where N is the pixel depth of the Z buffer.
33 | */
34 |
35 | class DepthComponentIntRetained extends DepthComponentRetained {
36 | int depthData[];
37 |
38 | /**
39 | * Constructs a new integer depth (z-buffer) component object with the
40 | * specified width and height.
41 | * @param width the width of the array of depth values
42 | * @param height the height of the array of depth values
43 | */
44 | void initialize(int width, int height) {
45 | type = DEPTH_COMPONENT_TYPE_INT;
46 | depthData = new int[width * height];
47 | this.width = width;
48 | this.height = height;
49 | }
50 |
51 | /**
52 | * Copies the specified depth data to this object.
53 | * @param depthData array of ints containing the depth data
54 | */
55 | void setDepthData(int[] depthData) {
56 | int i;
57 | for (i = 0; i < depthData.length; i++)
58 | this.depthData[i] = depthData[i];
59 | }
60 |
61 |
62 | /**
63 | * Copies the depth data from this object to the specified array.
64 | * @param depthData array of ints that will receive a copy of
65 | * the depth data
66 | */
67 | void getDepthData(int[] depthData) {
68 | int i;
69 |
70 | for (i = 0; i < this.depthData.length; i++)
71 | depthData[i] = this.depthData[i];
72 | }
73 |
74 | /**
75 | * retrieve depth data from input buffer
76 | */
77 | final void retrieveDepth(int[] buf, int wRead, int hRead) {
78 | int srcOffset, dstOffset, i;
79 |
80 | // Yup -> Ydown
81 | for (srcOffset = (hRead - 1) * wRead, dstOffset = 0,
82 | i = 0; i < hRead; i++,
83 | srcOffset -= wRead, dstOffset += width) {
84 |
85 | System.arraycopy(buf, srcOffset, depthData, dstOffset, wRead);
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/DepthComponentNativeRetained.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * A 2D array of depth (Z) values stored in the most efficient format for a
31 | * particular device. Values are not accessible by the user and may only be
32 | * used to read the Z values and subsequently write them back.
33 | */
34 |
35 | class DepthComponentNativeRetained extends DepthComponentRetained {
36 | // Change this to whatever native format is best...
37 | int depthData[];
38 |
39 | /**
40 | * Constructs a new native depth (z-buffer) component object with the
41 | * specified width and height.
42 | * @param width the width of the array of depth values
43 | * @param height the height of the array of depth values
44 | */
45 | void initialize(int width, int height) {
46 | type = DEPTH_COMPONENT_TYPE_NATIVE;
47 | depthData = new int[width * height];
48 | this.width = width;
49 | this.height = height;
50 | }
51 |
52 | /**
53 | * Copies the depth data from this object to the specified array.
54 | * @param depthData array of ints that will receive a copy of
55 | * the depth data
56 | */
57 | void getDepthData(int[] depthData) {
58 | int i;
59 | for (i = 0; i < this.depthData.length; i++)
60 | depthData[i] = this.depthData[i];
61 | }
62 |
63 | /**
64 | * retrieve depth data from input buffer
65 | */
66 | final void retrieveDepth(int[] buf, int wRead, int hRead) {
67 | int srcOffset, dstOffset, i;
68 |
69 | // Yup -> Ydown
70 | for (srcOffset = (hRead - 1) * wRead, dstOffset = 0,
71 | i = 0; i < hRead; i++,
72 | srcOffset -= wRead, dstOffset += width) {
73 |
74 | System.arraycopy(buf, srcOffset, depthData, dstOffset, wRead);
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/DepthComponentRetained.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * Abstract base class that defines a 2D array of depth (Z) values.
31 | */
32 |
33 |
34 | abstract class DepthComponentRetained extends NodeComponentRetained {
35 | // depth component types
36 | static final int DEPTH_COMPONENT_TYPE_INT = 1;
37 | static final int DEPTH_COMPONENT_TYPE_FLOAT = 2;
38 | static final int DEPTH_COMPONENT_TYPE_NATIVE = DEPTH_COMPONENT_TYPE_INT;
39 |
40 |
41 | // Width and height of DepthComponent---set by subclasses
42 | int width;
43 | int height;
44 | int type;
45 |
46 | /**
47 | * Retrieves the width of this depth component object
48 | * @return the width of the array of depth values
49 | */
50 | int getWidth() {
51 | return width;
52 | }
53 |
54 | /**
55 | * Retrieves the height of this depth component object
56 | * @return the height of the array of depth values
57 | */
58 | int getHeight() {
59 | return height;
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/Drawable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * Tagging interface for drawable (window) objects. The rendering pipelines
31 | * will define concrete classes that implement this interface. All code that
32 | * uses the tagged objects will be in the pipelines.
33 | */
34 | interface Drawable {
35 | // No methods or constants defined at this time
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/DrawingSurfaceObject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * The DrawingSurfaceObject class is used to manage native drawing surface
31 | */
32 |
33 | abstract class DrawingSurfaceObject extends Object {
34 |
35 | Canvas3D canvas;
36 | boolean gotDsiLock = false;
37 | boolean onScreen;
38 |
39 | abstract boolean renderLock();
40 | abstract void unLock();
41 | abstract void getDrawingSurfaceObjectInfo();
42 | abstract void invalidate();
43 |
44 | DrawingSurfaceObject(Canvas3D cv) {
45 | canvas = cv;
46 | onScreen = !cv.offScreen;
47 | }
48 |
49 | synchronized boolean isLocked() {
50 | return gotDsiLock;
51 | }
52 |
53 | synchronized void contextValidated() {
54 | canvas.validCtx = true;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/FreeListManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 |
30 | class FreeListManager {
31 |
32 | private static final boolean DEBUG = false;
33 |
34 | // constants that represent the freelists managed by the Manager
35 | static final int DISPLAYLIST = 0;
36 |
37 | private static int maxFreeListNum = 0;
38 |
39 | // what list we are going to shrink next
40 | private static int currlist = 0;
41 |
42 | static MemoryFreeList[] freelist = null;
43 |
44 | static void createFreeLists() {
45 | maxFreeListNum = 0;
46 | freelist = new MemoryFreeList[maxFreeListNum+1];
47 | freelist[DISPLAYLIST] = new IntegerFreeList();
48 | }
49 |
50 | // see if the current list can be shrunk
51 | static void manageLists() {
52 | // System.err.println("manageLists");
53 | if (freelist[currlist] != null) {
54 | freelist[currlist].shrink();
55 | }
56 |
57 | currlist++;
58 | if (currlist > maxFreeListNum) currlist = 0;
59 | }
60 |
61 | // return the freelist specified by the list param
62 | static MemoryFreeList getFreeList(int list) {
63 | if (list < 0 || list > maxFreeListNum) {
64 | if (DEBUG) System.err.println("illegal list");
65 | return null;
66 | }
67 | else {
68 | return freelist[list];
69 | }
70 | }
71 |
72 | static Object getObject(int listId) {
73 | return freelist[listId].getObject();
74 | }
75 |
76 | static void freeObject(int listId, Object obj) {
77 | freelist[listId].add(obj);
78 | }
79 |
80 | static void clearList(int listId) {
81 | freelist[listId].clear();
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/GeneralizedStripFlags.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * A class which implements GeneralizedStripFlags provides the means to access
31 | * the vertex replace code flags associated with each vertex of a generalized
32 | * strip. This allows a flexible representation of generalized strips for
33 | * various classes and makes it possible to provide a common subset of static
34 | * methods which operate only on their topology.
35 | *
36 | * @see GeneralizedStrip
37 | * @see GeneralizedVertexList
38 | */
39 | @Deprecated
40 | interface GeneralizedStripFlags {
41 |
42 | /**
43 | * This flag indicates that a vertex starts a new strip with clockwise
44 | * winding.
45 | */
46 | static final int RESTART_CW = 0 ;
47 |
48 | /**
49 | * This flag indicates that a vertex starts a new strip with
50 | * counter-clockwise winding.
51 | */
52 | static final int RESTART_CCW = 1 ;
53 |
54 | /**
55 | * This flag indicates that the next triangle in the strip is defined by
56 | * replacing the middle vertex of the previous triangle in the strip.
57 | */
58 | static final int REPLACE_MIDDLE = 2 ;
59 |
60 | /**
61 | * This flag indicates that the next triangle in the strip is defined by
62 | * replacing the oldest vertex of the previous triangle in the strip.
63 | */
64 | static final int REPLACE_OLDEST = 3 ;
65 |
66 | /**
67 | * This constant is used to indicate that triangles with clockwise vertex
68 | * winding are front facing.
69 | */
70 | static final int FRONTFACE_CW = 0 ;
71 |
72 | /**
73 | * This constant is used to indicate that triangles with counter-clockwise
74 | * vertex winding are front facing.
75 | */
76 | static final int FRONTFACE_CCW = 1 ;
77 |
78 | /**
79 | * Return the number of flags. This should be the same as the number of
80 | * vertices in the generalized strip.
81 | */
82 | int getFlagCount() ;
83 |
84 | /**
85 | * Return the flag associated with the vertex at the specified index.
86 | */
87 | int getFlag(int index) ;
88 | }
89 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/Geometry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * Geometry is an abstract class that specifies the geometry
31 | * component information required by a Shape3D node. Geometry objects
32 | * describe both the geometry and topology of the Shape3D nodes that
33 | * reference them. Geometry objects consist of four generic geometric
34 | * types:
35 | *
40 | * Each of these geometric types defines a visible object or set of 41 | * objects. A Geometry object is used as a component object of a Shape3D 42 | * leaf node. 43 | * 44 | */ 45 | 46 | public abstract class Geometry extends NodeComponent { 47 | 48 | /** 49 | * Specifies that this Geometry allows intersect operation. This 50 | * capability bit is set (true) by default for all Geometry objects. 51 | */ 52 | public static final int 53 | ALLOW_INTERSECT = CapabilityBits.GEOMETRY_ALLOW_INTERSECT; 54 | 55 | // Array for setting default read capabilities 56 | private static final int[] readCapabilities = { 57 | ALLOW_INTERSECT 58 | }; 59 | 60 | /** 61 | * Constructs a new Geometry object. 62 | */ 63 | public Geometry() { 64 | // set default read capabilities 65 | setDefaultReadCapabilities(readCapabilities); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/GeometryLock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Sun designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 | * CA 95054 USA or visit www.sun.com if you need additional information or 23 | * have any questions. 24 | * 25 | */ 26 | 27 | package org.jogamp.java3d; 28 | 29 | 30 | class GeometryLock { 31 | 32 | // Current thread holding the lock 33 | Thread threadId = null; 34 | 35 | // Whether the lock is currently owned 36 | boolean lockOwned = false; 37 | 38 | // Count > 1 , if there is nested lock by the same thread 39 | int count = 0; 40 | 41 | // Number of outstanding threads waiting for the lock 42 | int waiting = 0; 43 | 44 | 45 | synchronized void getLock() { 46 | Thread curThread = Thread.currentThread(); 47 | // If the thread already has the lock, incr 48 | // a count and return 49 | if (threadId == curThread) { 50 | count++; 51 | return; 52 | } 53 | // Otherwise, wait until the lock is released 54 | while (lockOwned) { 55 | try { 56 | waiting++; 57 | wait(); 58 | } catch (InterruptedException e) { 59 | System.err.println(e); 60 | } 61 | waiting--; 62 | } 63 | count++; 64 | // Acquire the lock 65 | lockOwned = true; 66 | threadId = curThread; 67 | } 68 | 69 | synchronized void unLock() { 70 | Thread curThread = Thread.currentThread(); 71 | if (threadId == curThread) { 72 | // If the lock count > 0, then return 73 | if (--count > 0) { 74 | return; 75 | } 76 | lockOwned = false; 77 | threadId = null; 78 | if (waiting > 0) { 79 | notify(); 80 | } 81 | } 82 | 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/org/jogamp/java3d/GeometryService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 JogAmp Community. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. The JogAmp Community designates 8 | * this particular file as subject to the "Classpath" exception as provided 9 | * by Sun in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * The views and conclusions contained in the software and documentation are those 18 | * of the authors and should not be interpreted as representing official policies, 19 | * either expressed or implied, of the JogAmp Community. 20 | * 21 | */ 22 | 23 | package org.jogamp.java3d; 24 | 25 | import java.util.ArrayList; 26 | 27 | import org.jogamp.vecmath.Point3f; 28 | 29 | /** 30 | * A service interface for certain geometric operations that are not available 31 | * in core Java 3D. 32 | *
33 | * In particular, the {@code j3d-core-utils} project provides additional 34 | * functionality under a different license, which is needed in some 35 | * circumstances by core Java 3D. Thus, historically, these two projects have 36 | * been co-dependent. This interface breaks the circular dependency by using 37 | * Java's service discovery mechanism: if {@code j3d-core-utils} is present on 38 | * the classpath, its {@code GeometryServiceImpl} will provide the functionality 39 | * defined here. Or if not (i.e., no suitable {@code GeometryService} 40 | * implementation can be discovered and instantiated}), then the Java3D core 41 | * will fail as gracefully as possible. 42 | *
43 | * 44 | * @see Font3D#triangulateGlyphs 45 | */ 46 | public interface GeometryService { 47 | 48 | /** 49 | * Loops through each island, calling triangulator once per island. Combines 50 | * triangle data for all islands together in one object. 51 | * 52 | * @param islandCounts TODO 53 | * @param outVerts TODO 54 | * @param contourCounts TODO 55 | * @param triangData TODO 56 | * @return total vertex count of the combined array 57 | */ 58 | int triangulateIslands(int[][] islandCounts, Point3f[][] outVerts, 59 | int[] contourCounts, ArrayListupdateData
method of the
36 | * GeometryArray object to be modified.
37 | *
38 | * @since Java 3D 1.2
39 | */
40 |
41 | public interface GeometryUpdater {
42 | /**
43 | * Updates geometry data that is accessed by reference.
44 | * This method is called by the updateData method of a
45 | * GeometryArray object to effect
46 | * safe updates to vertex data that
47 | * is referenced by that object. Applications that wish to modify
48 | * such data must implement this method and perform all updates
49 | * within it.
50 | *
37 | * NOTE: Applications should not extend this class directly.
38 | */
39 |
40 | public abstract class Leaf extends Node {
41 |
42 | /**
43 | * Construct and initialize the Leaf object.
44 | */
45 | public Leaf(){
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/LeafRetained.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 | import java.util.ArrayList;
29 |
30 | /**
31 | * LeafRetained node.
32 | */
33 | abstract class LeafRetained extends NodeRetained {
34 |
35 | SwitchState switchState = null;
36 |
37 | // temporary variable used during bounds computation, since
38 | // multiple mirror shapes could be pointing to the same shape3D
39 | boolean boundsDirty = false;
40 |
41 | // Appicable only to the mirror object
42 | void updateBoundingLeaf() {
43 |
44 | }
45 | protected Object clone(boolean forceDuplicate) {
46 | return super.clone();
47 | }
48 |
49 | void updateMirrorObject(Object[] args) {
50 | }
51 |
52 | void updateTransformChange() {
53 | }
54 |
55 | void updateBounds() {
56 | }
57 |
58 | void getMirrorObjects(ArrayList l, HashKey k) {
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/LightSet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 |
30 | class LightSet extends Object {
31 | /**
32 | * The Lights that make up this set
33 | */
34 | LightRetained[] lights = null;
35 |
36 | // The number of lights in this lightset, may be less than lights.length
37 | int nlights = 0;
38 |
39 | // A reference to the next LightSet
40 | LightSet next = null;
41 |
42 | // A reference to the previous LightSet
43 | LightSet prev = null;
44 |
45 | // A flag that indicates that lighting is on
46 | boolean lightingOn = true;
47 |
48 | // A flag that indicates that this light set has changed.
49 | boolean isDirty = true;
50 |
51 | /**
52 | * Constructs a new LightSet
53 | */
54 | LightSet(RenderBin rb, RenderAtom ra, LightRetained[] lights,
55 | int nlights, boolean lightOn) {
56 | this.reset(rb, ra, lights, nlights, lightOn);
57 | }
58 |
59 | void reset(RenderBin rb, RenderAtom ra, LightRetained[] lights,
60 | int nlights, boolean lightOn) {
61 | int i;
62 |
63 | this.isDirty = true;
64 | this.lightingOn = lightOn;
65 | if (this.lights == null || this.lights.length < nlights) {
66 | this.lights = new LightRetained[nlights];
67 | }
68 |
69 | for (i=0; i
41 | * There are two ways in which values can be specified for uniform
42 | * attributes: explicitly, by providing a value; and implicitly, by
43 | * defining a binding between a Java 3D system attribute and a uniform
44 | * attribute. This functionality is provided by two subclasses of
45 | * ShaderAttribute as follows:
46 | *
47 | * Here are code fragments from a simple program, Provides the core set of classes for the
11 | 3D graphics API for the Java platform; click here for more information,
13 | including explanatory material that was formerly found in the guide.
14 | The 3D API is an application
17 | programming interface used for writing three-dimensional graphics
18 | applications and applets. It gives developers high-level constructs for
19 | creating and manipulating 3D geometry and for constructing the
20 | structures used in rendering that geometry. Application developers can
21 | describe very large virtual worlds using these constructs, which
22 | provide the runtime system with enough information to render these worlds
23 | efficiently.
24 |
35 | *
40 | */
41 | public class SceneGraphCycleException extends IllegalSceneGraphException{
42 |
43 | /**
44 | * Create the exception object with default values.
45 | */
46 | public SceneGraphCycleException(){
47 | }
48 |
49 | /**
50 | * Create the exception object that outputs message.
51 | * @param str the message string to be output.
52 | */
53 | public SceneGraphCycleException(String str){
54 |
55 | super(str);
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/ShaderAttrLoc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * Tagging interface for shader attribute location objects. The rendering
31 | * pipelines will define concrete classes that implement this interface. All
32 | * code that uses the tagged objects will be in the pipelines.
33 | */
34 | interface ShaderAttrLoc {
35 | // No methods or constants defined at this time
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/ShaderAttribute.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 |
30 | /**
31 | * The ShaderAttribute object encapsulates a uniform attribute for a
32 | * shader programs. Uniform attributes (variables) are those
33 | * attributes whose values are constant during the rendering of a
34 | * primitive. Their values may change from primitive to primitive, but
35 | * are constant for each vertex (for vertex shaders) or fragment (for
36 | * fragment shaders) of a single primitive. Examples of uniform
37 | * attributes include a transformation matrix, a texture map, lights,
38 | * lookup tables, etc.
39 | *
40 | *
48 | *
55 | *
56 | * @see ShaderAttributeSet
57 | * @see ShaderProgram
58 | *
59 | * @since Java 3D 1.4
60 | */
61 |
62 | public abstract class ShaderAttribute extends NodeComponent {
63 | /**
64 | * Name of the shader attribute (immutable)
65 | */
66 |
67 | /**
68 | * Package scope constructor
69 | *
70 | */
71 | ShaderAttribute(String attrName) {
72 | if (attrName == null) {
73 | throw new NullPointerException();
74 | }
75 |
76 | ((ShaderAttributeRetained)this.retained).initializeAttrName(attrName);
77 | }
78 |
79 | /**
80 | * Retrieves the name of this shader attribute.
81 | *
82 | * @return the name of this shader attribute
83 | */
84 | public String getAttributeName() {
85 |
86 | return ((ShaderAttributeRetained)this.retained).getAttributeName();
87 |
88 | }
89 |
90 | }
91 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/ShaderAttributeBindingRetained.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 |
30 | /**
31 | * The ShaderAttributeBinding object encapsulates a uniform attribute
32 | * whose value is bound to a Java 3D system attribute. The
33 | * shader variable (attrName, value)
pairs, is used for explicitly
50 | * defined attributes(attrName, j3dAttrName)
pairs, is used for
53 | * implicitly defined, automatically tracked attributesattrName
is implicitly set to the
34 | * value of the corresponding Java 3D system attribute
35 | * j3dAttrName
during rendering. attrName
36 | * must be the name of a valid uniform attribute in the shader in
37 | * which it is used. Otherwise, the attribute name will be ignored and
38 | * a runtime error may be generated. j3dAttrName
must be
39 | * the name of a predefined Java 3D system attribute. An
40 | * IllegalArgumentException will be thrown if the specified
41 | * j3dAttrName
is not one of the predefined system
42 | * attributes. Further, the type of the j3dAttrName
43 | * attribute must match the type of the corresponding
44 | * attrName
variable in the shader in which it is
45 | * used. Otherwise, the shader will not be able to use the attribute
46 | * and a runtime error may be generated.
47 | */
48 |
49 | class ShaderAttributeBindingRetained extends ShaderAttributeRetained {
50 | String j3dAttrName;
51 |
52 | ShaderAttributeBindingRetained() {
53 | }
54 |
55 | void initJ3dAttrName(String j3dAttrName) {
56 | this.j3dAttrName = j3dAttrName;
57 | }
58 |
59 | /**
60 | * Retrieves the name of the Java 3D system attribute that is bound to this
61 | * shader attribute.
62 | *
63 | * @return the name of the Java 3D system attribute that is bound to this
64 | * shader attribute
65 | */
66 | String getJ3DAttributeName() {
67 | return j3dAttrName;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/ShaderAttributeRetained.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 |
30 | /**
31 | * The ShaderAttributeRetained object encapsulates a uniform attribute for a
32 | * shader programs.
33 | */
34 |
35 | abstract class ShaderAttributeRetained extends NodeComponentRetained {
36 |
37 | /**
38 | * Name of the shader attribute (immutable)
39 | */
40 | String attrName;
41 |
42 | /**
43 | * Package scope constructor
44 | */
45 | ShaderAttributeRetained() {
46 | }
47 |
48 | void initializeAttrName(String attrName) {
49 | this.attrName = attrName;
50 | }
51 |
52 | /**
53 | * Retrieves the name of this shader attribute.
54 | *
55 | * @return the name of this shader attribute
56 | */
57 | String getAttributeName() {
58 | return attrName;
59 | }
60 |
61 | @Override
62 | void initMirrorObject() {
63 | ((ShaderAttributeObjectRetained)mirror).initializeAttrName(this.attrName);
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/ShaderConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * The ShaderConstants class contains internal constants used by other
31 | * Shader classes.
32 | */
33 | class ShaderConstants extends Object {
34 |
35 | //
36 | // The following bits are used in the messages for various Shader objects.
37 | //
38 |
39 | // ShaderAttributeSet bits -- indicates which attribute
40 | // operation in this ShaderAttributeSet object is needed.
41 | static final int ATTRIBUTE_SET_PUT = 0x0001;
42 | static final int ATTRIBUTE_SET_REMOVE = 0x0002;
43 | static final int ATTRIBUTE_SET_CLEAR = 0x0004;
44 |
45 | // ShaderAttribute bits
46 | static final int ATTRIBUTE_VALUE_UPDATE = 0x0008;
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/ShaderErrorListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * Listener interface for monitoring errors in Shader Programs.
31 | * Compile and link errors are reported by the shader compiler, as are
32 | * runtime errors, such as those resulting from shader attributes that
33 | * aren't found or are of the wrong type.
34 | *
35 | * @see VirtualUniverse#addShaderErrorListener
36 | *
37 | * @since Java 3D 1.4
38 | */
39 | public interface ShaderErrorListener {
40 | /**
41 | * Invoked when an error occurs while compiling, linking or
42 | * executing a programmable shader.
43 | *
44 | * @param error object that contains the details of the error.
45 | */
46 | public void errorOccurred(ShaderError error);
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/ShaderId.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * Tagging interface for shader objects. The rendering pipelines
31 | * will define concrete classes that implement this interface. All code that
32 | * uses the tagged objects will be in the pipelines.
33 | */
34 | interface ShaderId {
35 | // No methods or constants defined at this time
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/ShaderProgramId.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * Tagging interface for shader program objects. The rendering pipelines
31 | * will define concrete classes that implement this interface. All code that
32 | * uses the tagged objects will be in the pipelines.
33 | */
34 | interface ShaderProgramId {
35 | // No methods or constants defined at this time
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/SoundException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 |
29 | /**
30 | * Indicates a problem in loading or playing a sound sample.
31 | */
32 | public class SoundException extends RuntimeException{
33 |
34 | /**
35 | * Create the exception object with default values.
36 | */
37 | public SoundException(){
38 | }
39 |
40 | /**
41 | * Create the exception object that outputs message.
42 | * @param str the message string to be output.
43 | */
44 | public SoundException(String str){
45 |
46 | super(str);
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/org/jogamp/java3d/TargetsInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Sun designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Sun in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 | * CA 95054 USA or visit www.sun.com if you need additional information or
23 | * have any questions.
24 | *
25 | */
26 |
27 | package org.jogamp.java3d;
28 | import java.util.ArrayList;
29 |
30 |
31 | interface TargetsInterface {
32 |
33 | static final int TRANSFORM_TARGETS = 0;
34 | static final int SWITCH_TARGETS = 1;
35 |
36 | // used by Switch, TransformGroup and SharedGroup
37 | abstract CachedTargets getCachedTargets(int type, int index, int child);
38 | abstract void resetCachedTargets(int type, CachedTargets[] newCt, int child);
39 | // used by TransformGroup and SharedGroup
40 | abstract int getTargetThreads(int type);
41 | abstract void updateCachedTargets(int type, CachedTargets[] newCt);
42 | abstract void computeTargetThreads(int type, CachedTargets[] newCt);
43 | abstract void updateTargetThreads(int type, CachedTargets[] newCt);
44 | abstract void propagateTargetThreads(int type, int childTargetThreads);
45 | abstract void copyCachedTargets(int type, CachedTargets[] newCt);
46 |
47 | // used by Switch and SharedGroup
48 | abstract ArrayListHelloUniverse: A Sample Java
10 | 3D Program
11 | HelloUniverse.java
,
12 | that creates a cube and a RotationInterpolator behavior object that
13 | rotates the cube at a constant rate of pi/2 radians per second. The
14 | HelloUniverse class creates the branch graph
15 | that includes the cube and the RotationInterpolator behavior. It then
16 | adds this branch graph to the Locale object generated by the
17 | SimpleUniverse utility.
18 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/Immediate1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/Immediate1.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing1.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing2.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing3.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing4.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/SceneGraphSharing5.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewBranch.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewBranch.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel1.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel10.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel11.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel12.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel13.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel14.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel2.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel3.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel4.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel5.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel6.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel7.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel8.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/ViewModel9.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/VirtualUniverse.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/VirtualUniverse.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/doc-files/intro.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/philjord/java3d-core/4ac08687236e9ce5cc09b563b54f29e33f6a77a7/src/main/javadoc/org/jogamp/java3d/doc-files/intro.gif
--------------------------------------------------------------------------------
/src/main/javadoc/org/jogamp/java3d/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
public class HelloUniverse ... {
public BranchGroup createSceneGraph() {
// Create the root of the branch graph
BranchGroup objRoot = new BranchGroup();
// Create the TransformGroup node and initialize it to the
// identity. Enable the TRANSFORM_WRITE capability so that
// our behavior code can modify it at run time. Add it to
// the root of the subgraph.
TransformGroup objTrans = new TransformGroup();
objTrans.setCapability(
TransformGroup.ALLOW_TRANSFORM_WRITE);
objRoot.addChild(objTrans);
// Create a simple Shape3D node; add it to the scene graph.
objTrans.addChild(new ColorCube(0.4));
// Create a new Behavior object that will perform the
// desired operation on the specified transform and add
// it into the scene graph.
Transform3D yAxis = new Transform3D();
Alpha rotationAlpha = new Alpha(-1, 4000);
RotationInterpolator rotator = new RotationInterpolator(
rotationAlpha, objTrans, yAxis,
0.0f, (float) Math.PI*2.0f);
BoundingSphere bounds =
new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
rotator.setSchedulingBounds(bounds);
objRoot.addChild(rotator);
// Have Java 3D perform optimizations on this scene graph.
objRoot.compile();
return objRoot;
}
public HelloUniverse() {
<set layout of container, construct canvas3d, add canvas3d>
// Create the scene; attach it to the virtual universe
BranchGroup scene = createSceneGraph();
SimpleUniverse u = new SimpleUniverse(canvas3d);
u.getViewingPlatform().setNominalViewingTransform();
u.addBranchGraph(scene);
}
}