I´m currently working on a simple modification of the superCAD-library so that it is able to export texture-coordinates (and normals in the long run). Theoretically this shouldn´t be a big problem, I got the texture-coordinates and the texture-image from the base class PGraphics / PGraphics3d and thus I got all the information and data I need. Though it doesn´t work, I get the
Exception in thread "Animation Thread" java.lang.RuntimeException: You must first call texture() before using u and v coordinates with vertex()
(mParent is the PApplet I pass to every object which has to be drawn, it uses OpenGL as Graphics-API)
That´s it, no big deal, I start the recording from another slice of code, as every object in my code draws itself. Though I use the exact calls which Guillaume Labelle uses in his superCAD-examples (which are similar to the DXF-export examples of processing). Just to be complete, here are the initializations:
When I first saw the exception, I thought, that it should be enough to simply overwrite the "texture()"-function (the library does the same with beginShape(), endShape(), fill(), vertex() etc.) though it doesn´t have any effect. I call the texture-function in line 4 of the first code snippet (the texture is definitely set, the if-block is entered, though there´s no effect, the exception remains). I looked at the code of PGraphic and PGraphic3d and there´s nothing remarkable about the functions, so that I don´t have any idea, why it doesn´t work out...
If I don´t use textures the geometry is exported correctly with the same code, so the library generally seems to work, but it doesn´t like my textures...
Does anyone have an idea, why this doesn´t work or even better, how I can make it work?
I´ve searched quite a while, though I didn´t get a clear answer within the forum threads. My problem is the following. I´m using processing with OpenGL as renderer and I´d like to have a wrapped texture. I´m using the normalized texture space. If I use values for u and v with values > 1, nothing changes.
So here´s my question. Is it possible to create wrap textures with processing without using direct calls to OpenGL?
I´m working on an application for dynamically generating image-based views of 3d-models. As I don´t want to depend on applets, I´d like to use Processing simply to load and render images of 3d-models and pass them back as an image. The whole thing should work as a web-service relaized as spring-servlet, which is called by the client. The web-service contains a PApplet-class which should generate the views and pass them back. As I don´t want to render to screen, I´m using a PGraphics-instance. Though the server starts up correctly (even creating the PGraphics rendercontext without any complains), it crashes completely as soon as I call beginDraw() of my PGraphics-object. I have searched quite a while, but I haven´t found anything regarding such a problem. This is why I´d like to ask wether or not this architecture might work and wether processing can be executed within a tomcat-server. If not, I´ll try a different approach...