Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - EgonOlsen

Pages: 1 ... 791 792 [793] 794 795 ... 822
11881
Support / Undersampling
« on: March 18, 2005, 02:55:18 pm »
No, that's not possible ATM, i'm afraid. I also think that it would look strange to use a 0.75 factor and upsample that for example. Like the scaling a TFT does in these cases... barely usable IMHO.

11882
Support / Object Rotation
« on: March 16, 2005, 07:43:34 am »
Depends on what you mean exactly. You may try to align them using Camera.align(<Object3D>) or use Camera.lookAt(<SimpleVector>) with the transformed center of the Object3D as point to look at.

11883
Support / Applying Colors to Objects - a possible solution
« on: March 16, 2005, 07:40:24 am »
Quote from: "tomzwo"
have you thought about my question (edged in different color)?
Opps, i must have missed this one...to keep it short: That's hardly possible in jPCT without adding additional geometry that simulates it. You may draw a wireframe over the rendered scene, but that's most likely not what you want.

11884
Support / Object Rotation
« on: March 15, 2005, 12:40:30 am »
Quote from: "bgilb3"
so complicated :oops:
Not really. It's in the CarTest.java in moveCamera. It's not that complicated...

11885
Feedback / Do you have any ideas of porting the engine to J2ME?
« on: March 14, 2005, 05:10:33 pm »
No, i don't have such plans ATM. I think that jPCT is too demanding in terms of memory and CPU requirements to be usefull on current mobile devices.

11886
Support / Object Rotation
« on: March 14, 2005, 05:06:55 pm »
Depends on your actual needs. One way of doing it be found in sources of the  car example.

11887
Support / Object Rotation
« on: March 13, 2005, 06:47:10 pm »
Try something like this:

Code: [Select]
SimpleVector s=shape.getZAxis();
s.scalarMul(speed);
shape.translate(s);

11888
Support / Object Rotation
« on: March 13, 2005, 05:29:00 pm »
If i understand you correctly, try something like

Code: [Select]
shape.translate(shape.getZAxis());

11889
Support / Applying Colors to Objects - a possible solution
« on: March 10, 2005, 11:08:46 pm »
Adding a constructor that takes an Image should be easy and may appear in one of the next versions. Anyway, thanx for sharing the code. May i ask what kind of project that is?

11890
Support / VertexController
« on: March 10, 2005, 12:46:21 am »
Quote from: "tomzwo"
Did I get this right: applying VertexController Things and other transformations go together quite well? That would make things very easy: translate and rotate with the standard methods - (btw: being able to set the rotation pivot spot is very useful) and do some non-uniform scaling with VertexController.
That's the way it's supposed to work.

Quote
Something else: I found a - in my eyes - rather smart solution for the obstacle of not being able to apply colors to objects. Interested, anyone? if(InterestList.length > 0) postExample();
I'm not sure what you mean, but i think that i'm interested... :wink:

11891
Support / VertexController
« on: March 09, 2005, 05:16:14 pm »
Well, the example that i've written in that thread ommits an important step: How to apply the assigned controller... :wink: But it's quite simple. Just call
applyVertexController(); on the Object3D's Mesh and it will be applied.
Vertices and normals in the controller are all in object space, so that transformations don't matter. If you need to pre-transform the object, have a look at rotateMesh() and translateMesh() in Object3D.

11892
Support / Fast access to pixel data?
« on: March 08, 2005, 05:01:31 pm »
10 seconds for a 500*500 image :?: That's way too much. I'm using a PixelGrabber to access the texture data after loading...and i'm loading a lot of 512*512 textures. Can you post some code?

11893
Feedback / kind of brain storming
« on: March 07, 2005, 06:32:18 pm »
Is it supposed to show a single plane only? Or am i doing something wrong?

11894
Support / Sound?
« on: March 07, 2005, 06:18:30 pm »
The examples don't have any sound. Paradroidz has (http://www.jpct.net/paradroidz). I'm using a two way approach in this game as i'm using OpenAL (provided by LWJGL) where available and JavaSound where not (or where OpenAL doesn't work). This works fine so far. If you intend to do an applet, you may be limited to JavaSound anyway...i don't know if LWJGL's OpenAL stuff will work in an applet.
Just keep in mind that JavaSound in Java5 is totally screwed up and that you have to use a workaround to get it running correctly.

11895
German corner / Einfaches Beispiel?
« on: March 02, 2005, 11:19:41 pm »
Für Applets ist es nicht anders, als für Applikationen, wenn man von den naturgegebenen Unterschieden einmal absieht. Es gab mal ein Applet-Beispiel, aber in 0.97 ist es rausgeflogen. Die Version 0.96 mit dem Beispiel gibt es noch hier drin: http://www.jpct.net/download/
Aber nimm davon nur das Beispiel, nicht die API selber..0.96 ist uralt. Ob das Beispiel noch mit 1.05 compiliert weiß ich nicht genau, aber wenn nicht, dann sollte nicht viel zu ändern sein.
Um ein einfaches Object zu erzeugen, musst du einfach ein Object3D mit der gewünschten Polygonanzahl erzeugen und mit addTriangle(...) deine Dreiecke hinzufügen. Hier ein Beispiel für einen Ring:

Code: [Select]
private static Object3D buildRing(float maxSize, float minSize, float texSize) {
      final float rot=2*0.19634954084936207740391521145497f;

      Object3D obj=new Object3D(16*2);
      float div=Math.abs(maxSize)*2;

      SimpleVector s1=new SimpleVector(-maxSize, 0, 0);
      SimpleVector s2=new SimpleVector(-minSize, 0, 0);
      SimpleVector st=new SimpleVector(-texSize, 0, 0);
      SimpleVector e1=null;
      SimpleVector e2=null;
      SimpleVector et=null;

      int i=0;
      while (i<16) {
         i++;
         e1=new SimpleVector(s1);
         e2=new SimpleVector(s2);
         et=new SimpleVector(st);

         e1.rotateY(rot);
         e2.rotateY(rot);
         et.rotateY(rot);

         if (i==16) {
            e1=new SimpleVector(-maxSize, 0, 0);
            e2=new SimpleVector(-minSize, 0, 0);
            et=new SimpleVector(-texSize, 0, 0);
         }

         float us1=s1.x/div+0.5f;
         float vs1=s1.z/div+0.5f;
         float us2=st.x/div+0.5f;
         float vs2=st.z/div+0.5f;

         float ue1=e1.x/div+0.5f;
         float ve1=e1.z/div+0.5f;
         float ue2=et.x/div+0.5f;
         float ve2=et.z/div+0.5f;

         obj.addTriangle(s1, us1, vs1, e1, ue1, ve1, s2, us2, vs2);
         obj.addTriangle(e1, ue1, ve1, e2, ue2, ve2, s2, us2, vs2);

         s1=e1;
         s2=e2;
         st=et;
      }
      return obj;
   }


Für ein Band ist es noch eine ganze Ecke einfacher.

Pages: 1 ... 791 792 [793] 794 795 ... 822