[英]online java webstart applet will not allow mouseDragged() on mac osx but works on windows. Am I missing something?
* note I have been reading and it may or may not be that the java plugin for Apple Inc doesn't allow this, but I feel like its something I am doing. * 请注意,我一直在阅读,可能是(也可能不是)Apple Inc.的java插件不允许这样做,但是我感觉它在做我的事情。 that being said....* 话虽如此....*
I wrote a java applet using Processing 1.5.1
... After uploading to my website it works perfectly on windows using IE, FF, Safari, and Chrome. 我使用Processing 1.5.1
编写了一个Java applet ...上传到我的网站后,它在使用IE,FF,Safari和Chrome的Windows上可以完美运行。
However, NONE of the browsers allow it to work correctly on mac osx. 但是,没有浏览器允许它在mac osx上正常工作。 It will load and display fine but you can not interact with it at all. 它会加载并正常显示,但您根本无法与它进行交互。
all the app does is load an .obj and let you rotate it when the mouse is dragged. 该应用程序所做的全部工作就是加载.obj,并在拖动鼠标时旋转它。
Very simple program. 很简单的程序。 but the mouse dragged functionality doesnt work on mac for some reason. 但由于某些原因,鼠标拖动功能在Mac上不起作用。 Its like the applet never grabs focus from the browser or OS. 就像小程序一样,它永远不会吸引浏览器或OS的关注。
know anything that I could do? 知道我能做些什么? I'm using java webstart. 我正在使用java webstart。
*Processing generates the .jar and java script when it exports the applet. *处理在导出小程序时会生成.jar和Java脚本。 Do I need to add something to my sketch to make it work for macs? 我需要在我的草图中添加一些内容以使其适用于Mac吗? This is my processing sketch: 这是我的处理草图:
//this sketch was created as an example for the IMA
//by Joseph Aaron Campbell
//josephaaroncampbell.com
//it uses OBJLoader and the SAITO example as a base
import processing.opengl.*;
import processing.opengl.PGraphicsOpenGL;//put this in because I got a random error looking for
//it.probably dont need it
import saito.objloader.*;
OBJModel model ;
float rotX, rotY;
void setup()
{
size(640, 450, P3D);
frameRate(30);
///keep your poly count 32000 and below for obj files
//'or youre going to have a bad time'
//
//create and load instance of model
model = new OBJModel(this, "vase_18.obj", "absolute", TRIANGLES);
model.enableDebug();
//scale of model. not sure the relationship to original size
model.scale(10);
model.translateToCenter();
stroke(255);
noStroke();
}
void draw()
{
//what color is your background? 0=black, 255=white
background(15);
//add some info about model and origins
String s = "Original Vase found at: Http://www.imamuseum.org/art/collections/artwork/abstract-vessel-black Artist: Odundo, Magdalene";
fill(200, 200, 200);
textSize(12);
textMode(SCREEN);
textSize(12);
text(s, 15, 20, 450, 50);
//retrieve mouse cordinates for later use
//adds directional light to position of mouse
float dirY = (mouseY / float(height) - 0.5) * 2;
float dirX = (mouseX / float(width) - 0.5) * 2;
//Lights
directionalLight(100,100, 100, -300, 150, -1);
lightSpecular(255, 255, 255);
shininess(15.0);
directionalLight(145,145,145, 300, 200, 1);
directionalLight(100,100,100, -400,400,-1);
//pushMatrix and popMatrix create little bubble for model to be in
pushMatrix();//begin changes to model
translate(width/2, height/2, 0);
rotateX(rotY*0.4);
rotateY(rotX*0.4);
model.draw();
popMatrix();//end changes to model
}
void mouseDragged()
{
rotX += (mouseX - pmouseX) * 0.01;
rotY -= (mouseY - pmouseY) * 0.01;
}//mousevoid
how I am loading the sketch via html generated by Processing: 我如何通过Processing生成的html加载草图:
...
<div id="vase_container">
<applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
width="640"
height="450"
archive="http://absolute path to/vase.jar,
http://absolute path to/opengl.jar,
http://absolute path to/OBJLoader.jar,
http://absolute path to/core.jar,
http://jogamp.org/deployment/jogamp-current/jar/applet-launcher.jar,
http://jogamp.org/deployment/jogamp-current/jar/jogl.all.jar,
http://jogamp.org/deployment/jogamp-current/jar/gluegen-rt.jar">
<!--http://jogamp.org/deployment/webstart/jogl-demos/jogl-demos.jar-->
<param name="codebase_lookup" value="false" />
<param name="subapplet.classname" value="vase" />
<!--<param name="subapplet.displayname" value="Pretty Name Here">-->
<param name="noddraw.check" value="true" />
<param name="progressbar" value="true" />
<param name="jnlpNumExtensions" value="1" />
<param name="jnlpExtension1"
value="http://jogamp.org/deployment/jogamp-current/jogl-all-awt.jnlp" />
<param name="java_arguments" value="-Dsun.java2d.noddraw=true" />
<!--<param name="jnlp_href" value="applet-gears.jnlp">-->
....
Processing
interfaces with OpenGL
through JOGL
. 通过JOGL
Processing
与OpenGL
接口。 You probably need to build a Mac OS version, which will require installing the Mac Developer Tools to get the OpenGL headers. 您可能需要构建Mac OS版本,这将需要安装Mac Developer Tools来获取OpenGL标头。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.