[DEV] add draw triangles
This commit is contained in:
parent
e9541980c0
commit
920ac8cb20
@ -22,7 +22,7 @@ import org.atriasoft.gale.key.KeyType;
|
||||
import org.atriasoft.gale.resource.ResourceManager;
|
||||
|
||||
interface ActionToDoInAsyncLoop {
|
||||
public void run(GaleContext context);
|
||||
void run(GaleContext context);
|
||||
}
|
||||
|
||||
enum ApplicationState {
|
||||
|
@ -27,7 +27,6 @@ public class ResourceColored3DObject extends Resource {
|
||||
private int oGLMatrixView;
|
||||
|
||||
protected ResourceColored3DObject() {
|
||||
super();
|
||||
// get the shader resource :
|
||||
this.oGLPosition = 0;
|
||||
this.program = ResourceProgram.create(new Uri("DATA", "simple3D.vert", "gale"), new Uri("DATA", "simple3D.frag", "gale"));
|
||||
@ -492,6 +491,15 @@ public class ResourceColored3DObject extends Resource {
|
||||
draw(tmpVertices, tmpColor, transformationMatrix, true, true);
|
||||
}
|
||||
|
||||
public void drawTriangle(final Vector3f p1, final Vector3f p2, final Vector3f p3, final Matrix4f transformationMatrix, final Color tmpColor) {
|
||||
final List<Vector3f> tmpVertices = new ArrayList<>();
|
||||
tmpVertices.add(p1);
|
||||
tmpVertices.add(p2);
|
||||
tmpVertices.add(p3);
|
||||
//Log.info("display " << tmpVertices.size() << " vertices form " << indice.size());
|
||||
draw(tmpVertices, tmpColor, transformationMatrix, true, true);
|
||||
}
|
||||
|
||||
public void drawTriangles(final List<Vector3f> vertex, final List<Integer> indice, final Matrix4f transformationMatrix, final Color tmpColor) {
|
||||
drawTriangles(vertex, indice, transformationMatrix, tmpColor, new Vector3f(0.0f, 0.0f, 0.1f));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user