-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
外部ライブラリ webcamcaptureの追加 webcamcaptureのサンプルプログラムを追加 add jogl libdary add webcamcapture library add webcam capture sample
- Loading branch information
Showing
282 changed files
with
58,210 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
sample/jogl/src/jp/nyatla/nyartoolkit/jogl/sample/sketch/webcamcapture/WebCamSample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
* PROJECT: NyARToolkit JOGL sample program. | ||
* -------------------------------------------------------------------------------- | ||
* The MIT License | ||
* Copyright (c) 2008 nyatla | ||
* airmail(at)ebony.plala.or.jp | ||
* http://nyatla.jp/nyartoolkit/ | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
* | ||
*/ | ||
package jp.nyatla.nyartoolkit.jogl.sample.sketch.webcamcapture; | ||
|
||
|
||
import java.awt.Dimension; | ||
import javax.media.opengl.*; | ||
|
||
import com.github.sarxos.webcam.Webcam; | ||
import jp.nyatla.nyartoolkit.jogl.sketch.GlSketch; | ||
import jp.nyatla.nyartoolkit.jogl.utils.*; | ||
import jp.nyatla.nyartoolkit.markersystem.NyARMarkerSystemConfig; | ||
import jp.nyatla.nyartoolkit.markersystem.NyARSensor; | ||
import jp.nyatla.nyartoolkit.utils.j2se.NyARBufferedImageRaster; | ||
/** | ||
* WebcamCaptureの映像を使うサンプルです。 | ||
* ARマーカには、patt.hiroを使用して下さい。 | ||
*/ | ||
public class WebCamSample extends GlSketch | ||
{ | ||
private Webcam camera; | ||
private NyARGlMarkerSystem nyar; | ||
private NyARGlMarkerSystemRender render; | ||
private NyARSensor sensor; | ||
public void setup(GL gl)throws Exception | ||
{ | ||
this.size(640,480); | ||
NyARMarkerSystemConfig config = new NyARMarkerSystemConfig(640,480); | ||
this.camera=Webcam.getDefault(); | ||
this.camera.setViewSize(new Dimension(640,480)); | ||
this.nyar=new NyARGlMarkerSystem(config); //create MarkerSystem | ||
this.render=new NyARGlMarkerSystemRender(this.nyar); | ||
this.sensor=new NyARSensor(config.getScreenSize()); | ||
this.id=this.nyar.addARMarker(ARCODE_FILE,16,25,80); | ||
// this.id=this.nyar.addPsARPlayCard(1,80); | ||
// this.id=this.nyar.addNyIdMarker(0,80); //for NyIdmarker #0 | ||
gl.glEnable(GL.GL_DEPTH_TEST); | ||
this.camera.open(); | ||
} | ||
private final static String ARCODE_FILE = "../../Data/patt.hiro"; | ||
private int id; | ||
|
||
public void draw(GL gl)throws Exception | ||
{ | ||
synchronized(this.camera){ | ||
try { | ||
this.sensor.update(new NyARBufferedImageRaster(this.camera.getImage())); | ||
this.render.drawBackground(gl, this.sensor.getSourceImage()); | ||
this.render.loadARProjectionMatrix(gl); | ||
|
||
this.nyar.update(this.sensor); | ||
if(this.nyar.isExistMarker(this.id)){ | ||
this.render.loadMarkerMatrix(gl,this.id); | ||
this.render.colorCube(gl,40,0,0,20); | ||
} | ||
Thread.sleep(1); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
public static void main(String[] args) | ||
{ | ||
new WebCamSample().run(); | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
The GlueGen source code is mostly licensed under the New BSD 2-clause license, | ||
however it contains other licensed material as well. | ||
|
||
Other licensed material is compatible with the 'New BSD 2-Clause License', | ||
if not stated otherwise. | ||
|
||
'New BSD 2-Clause License' incompatible materials are optional, they are: | ||
|
||
NONE | ||
|
||
Below you find a detailed list of licenses used in this project. | ||
|
||
+++ | ||
|
||
The content of folder 'make/lib' contains build-time only | ||
Java binaries (JAR) to ease the build setup. | ||
Each JAR file has it's corresponding LICENSE file containing the | ||
source location and license text. None of these binaries are contained in any way | ||
by the generated and deployed GlueGen binaries. | ||
|
||
+++ | ||
|
||
L.1) The GlueGen source tree contains code from the JogAmp Community | ||
which is covered by the Simplified BSD 2-clause license: | ||
|
||
Copyright 2010 JogAmp Community. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are | ||
permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of | ||
conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list | ||
of conditions and the following disclaimer in the documentation and/or other materials | ||
provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR | ||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
The views and conclusions contained in the software and documentation are those of the | ||
authors and should not be interpreted as representing official policies, either expressed | ||
or implied, of JogAmp Community. | ||
|
||
You can address the JogAmp Community via: | ||
Web http://jogamp.org/ | ||
Forum/Mailinglist http://jogamp.762907.n3.nabble.com/ | ||
Chatrooms | ||
IRC irc.freenode.net #jogamp | ||
Jabber conference.jabber.org room: jogamp (deprecated!) | ||
Repository http://jogamp.org/git/ | ||
Email mediastream _at_ jogamp _dot_ org | ||
|
||
|
||
L.2) The GlueGen source tree contains code from Sun Microsystems, Inc. | ||
which is covered by the New BSD 3-clause license: | ||
|
||
Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
- Redistribution of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
- Redistribution in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
Neither the name of Sun Microsystems, Inc. or the names of | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
This software is provided "AS IS," without a warranty of any kind. ALL | ||
EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | ||
INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | ||
PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN | ||
MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR | ||
ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | ||
DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR | ||
ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR | ||
DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE | ||
DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, | ||
ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF | ||
SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | ||
|
||
You acknowledge that this software is not designed or intended for use | ||
in the design, construction, operation or maintenance of any nuclear | ||
facility. | ||
|
||
L.3) The GlueGen source tree contains CGRAM http://www.antlr.org/grammar/cgram/, | ||
a ANSI-C parser implementation using ANTLR, which is being used | ||
in the compile time part only. | ||
It is covered by the Original BSD 4-clause license: | ||
|
||
Copyright (c) 1998-2000, Non, Inc. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
Redistributions of source code must retain the above copyright | ||
notice, this list of conditions, and the following disclaimer. | ||
|
||
Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions, and the following disclaimer in | ||
the documentation and/or other materials provided with the | ||
distribution. | ||
|
||
All advertising materials mentioning features or use of this | ||
software must display the following acknowledgement: | ||
|
||
This product includes software developed by Non, Inc. and | ||
its contributors. | ||
|
||
Neither name of the company nor the names of its contributors | ||
may be used to endorse or promote products derived from this | ||
software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS | ||
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COMPANY OR CONTRIBUTORS BE | ||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. | ||
|
||
A.1) The GlueGen source tree contains code from The Apache Software Foundation | ||
which is covered by the Apache License Version 2.0 | ||
|
||
Apache Harmony - Open Source Java SE | ||
===================================== | ||
|
||
<http://harmony.apache.org/> | ||
|
||
Author: The Apache Software Foundation (http://www.apache.org/). | ||
|
||
Copyright 2006, 2010 The Apache Software Foundation. | ||
|
||
Apache License Version 2.0, January 2004 | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Or within this repository: doc/licenses/Apache.LICENSE-2.0 | ||
|
||
Files: | ||
- src/java/com/jogamp/common/net/Uri.java | ||
(derived from java.net.URI.Helper and heavily modified) | ||
|
||
A.2) The GlueGen source tree contains code from Ben Mankin, a.k.a 'Shevek', | ||
which is covered by the Apache License Version 2.0 | ||
|
||
JCPP - A Java C Preprocessor | ||
============================= | ||
|
||
<http://www.anarres.org/projects/jcpp/> | ||
<https://github.com/shevek/jcpp> | ||
|
||
Author: Ben Mankin, a.k.a 'Shevek' (http://www.anarres.org/about/). | ||
|
||
Copyright (c) 2007-2008, Shevek | ||
|
||
Apache License Version 2.0, January 2004 | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Or within this repository: doc/licenses/Apache.LICENSE-2.0 | ||
|
||
Files: | ||
The complete git submodule 'jcpp', | ||
which is a patched version of the original mentioned above. | ||
|
||
Used for the compile-time module gluegen.jar only. | ||
|
Binary file added
BIN
+6.85 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-linux-amd64.jar
Binary file not shown.
Binary file added
BIN
+6.73 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-linux-i586.jar
Binary file not shown.
Binary file added
BIN
+5.83 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-macosx-ppc.jar
Binary file not shown.
Binary file added
BIN
+7.11 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-macosx-universal.jar
Binary file not shown.
Binary file added
BIN
+6.76 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-solaris-amd64.jar
Binary file not shown.
Binary file added
BIN
+6.56 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-solaris-i586.jar
Binary file not shown.
Binary file added
BIN
+6.99 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-solaris-sparc.jar
Binary file not shown.
Binary file added
BIN
+7.09 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-solaris-sparcv9.jar
Binary file not shown.
Binary file added
BIN
+6.92 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-windows-amd64.jar
Binary file not shown.
Binary file added
BIN
+5.46 KB
utils/jogl/extlib/gluegen-old-1.0b6/gluegen-rt-natives-windows-i586.jar
Binary file not shown.
Binary file not shown.
Oops, something went wrong.