Start from scratch.

origin
Joshua Sigona 3 years ago
parent b7e570dd5f
commit 0bb1e490c3
  1. 36
      .classpath
  2. 34
      .project
  3. 3
      .settings/org.eclipse.core.resources.prefs
  4. 2
      .settings/org.eclipse.jdt.apt.core.prefs
  5. 9
      .settings/org.eclipse.jdt.core.prefs
  6. 4
      .settings/org.eclipse.m2e.core.prefs
  7. 19
      src/sig/Panel.java
  8. 8
      src/sig/SigRenderer.java

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SigRenderer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1635805301937</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

@ -0,0 +1,3 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
encoding/src=UTF-8

@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false

@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

@ -67,20 +67,11 @@ public class Panel extends JPanel implements Runnable {
final int h=SigRenderer.SCREEN_HEIGHT; final int h=SigRenderer.SCREEN_HEIGHT;
if(p.length != width * height) return; if(p.length != width * height) return;
for (int x=0;x<SigRenderer.SCREEN_WIDTH/SigRenderer.RESOLUTION;x++) { for (int x=0;x<width;x++) {
for (int y=0;y<SigRenderer.SCREEN_HEIGHT/SigRenderer.RESOLUTION;y++) { for (int y=0;y<height;y++) {
Vector3f dir = new Vector3f((-SigRenderer.SCREEN_WIDTH/2f+x*SigRenderer.RESOLUTION),(-SigRenderer.SCREEN_HEIGHT/2f+y*SigRenderer.RESOLUTION),SigRenderer.SCREEN_WIDTH); boolean found=false;
if (SigRenderer.tri.rayTriangleIntersect(SigRenderer.origin, dir)) { if (!found) {
p[ (int)(SigRenderer.SCREEN_WIDTH-x*SigRenderer.RESOLUTION) + (int)(SigRenderer.SCREEN_HEIGHT-y*SigRenderer.RESOLUTION) * width] = Color.WHITE.getRGB(); p[ (int)(x*SigRenderer.RESOLUTION) + (int)(y*SigRenderer.RESOLUTION) * width] = Color.WHITE.getRGB();
}
if (SigRenderer.tri2.rayTriangleIntersect(SigRenderer.origin, dir)) {
p[ (int)(SigRenderer.SCREEN_WIDTH-x*SigRenderer.RESOLUTION) + (int)(SigRenderer.SCREEN_HEIGHT-y*SigRenderer.RESOLUTION) * width] = Color.BLUE.getRGB();
}
if (SigRenderer.tri3.rayTriangleIntersect(SigRenderer.origin, dir)) {
p[ (int)(SigRenderer.SCREEN_WIDTH-x*SigRenderer.RESOLUTION) + (int)(SigRenderer.SCREEN_HEIGHT-y*SigRenderer.RESOLUTION) * width] = Color.RED.getRGB();
}
if (SigRenderer.tri4.rayTriangleIntersect(SigRenderer.origin, dir)) {
p[ (int)(SigRenderer.SCREEN_WIDTH-x*SigRenderer.RESOLUTION) + (int)(SigRenderer.SCREEN_HEIGHT-y*SigRenderer.RESOLUTION) * width] = Color.GREEN.getRGB();
} }
} }
} }

@ -120,16 +120,16 @@ public class SigRenderer implements KeyListener,MouseListener,MouseMotionListene
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) { switch (e.getKeyCode()) {
case KeyEvent.VK_UP:{ case KeyEvent.VK_UP:{
origin.add(new Vector3f(0,0,-1)); origin.add(new Vector3f(0,0,-0.05f));
}break; }break;
case KeyEvent.VK_RIGHT:{ case KeyEvent.VK_RIGHT:{
origin.add(new Vector3f(1,0,0)); origin.add(new Vector3f(0.05f,0,0));
}break; }break;
case KeyEvent.VK_LEFT:{ case KeyEvent.VK_LEFT:{
origin.add(new Vector3f(-1,0,0)); origin.add(new Vector3f(-0.05f,0,0));
}break; }break;
case KeyEvent.VK_DOWN:{ case KeyEvent.VK_DOWN:{
origin.add(new Vector3f(0,0,1)); origin.add(new Vector3f(0,0,0.05f));
}break; }break;
} }
} }

Loading…
Cancel
Save