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 - eye1

Pages: 1 2 [3] 4 5
31
Support / Texture resizing
« on: February 09, 2007, 05:05:52 pm »
I figurated it out.

Code: [Select]

   public static BufferedImage scaleImage(BufferedImage image, double factorW, double factorH)
   {
      BufferedImage scaled = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB);
      AffineTransformOp op = new AffineTransformOp(
      AffineTransform.getScaleInstance(factorW, factorH), null);
      image = op.filter(image, null);
      scaled.getGraphics().drawImage(image, 0, 0, image.getWidth(), image.getHeight(), null);
      return scaled;
  }

32
Support / Texture resizing
« on: February 09, 2007, 02:36:19 pm »
Hello!

I would like to do next thing.

Currently i blit some textures on screen. The textures are designed for highest resolution application will support. I would like to have/program method which will, when i start application, resize the Texture to a size, which will fit configured resolution. Since the Textures must be n^2 in size. The actuall size of image shouldn't be resized. Only content of image. I'll blit then only the part of texture.

Any hints?

33
Support / Changing Display Mode
« on: January 21, 2007, 03:05:34 pm »
I'm going to buy a PC on which will be only running application which I developed in jpct. (Live Warehouse Visualisation) Display will be on LCD television screen with HDTV 1080p resolution. And I would like to know on which parts of hardware should i invest the most, so taht I could render as detailed graphics as possible.

34
Support / Changing Display Mode
« on: January 17, 2007, 12:44:43 pm »
Hello

I would like to know which graphic card would suite best for programs runing on jpct (OpenGL).

I had in mind this one

http://ati.amd.com/products/fireglv3400/index.html

Is this a good choice?

I would like to get good performance on high resolution with lot of polygons rendered.

Should i invest in graphic card or more on other parts of hardware?

35
Support / How to rescale a object3D to a desired size.
« on: January 05, 2007, 04:03:30 pm »
Another question?

When I merge two objects into one. How do I position them before merging them?

36
Support / How to rescale a object3D to a desired size.
« on: January 04, 2007, 04:56:19 pm »
Code: [Select]
     Matrix rot = object.getRotationMatrix();
      float[] dump = rot.getDump();
      dump[0] = trackLength;
      rot.setDump(dump);
      object.setRotationMatrix(rot);


This code scaled object by x axis :)

4 now i didn't found any problem.

I'm wondering if there is a way to limit which properties are inherited by child of parent object?

37
Projects / Warehouse Visualisation
« on: December 29, 2006, 05:46:42 pm »

38
Support / strange movement
« on: December 29, 2006, 11:05:52 am »
How are you rendering? Do you use full processing time (no sleep)?

If you do, than it is possible that when you rotate it, more objects needs to be rendered or something like that and that causes that movement is much slower. Since one rendering loop takes longer.

39
Support / How to rescale a object3D to a desired size.
« on: December 28, 2006, 02:33:56 pm »
single-axis scale matrix... can anyone tell me how to get it?

i can get only translate matrix and rotation matrix from Object3D

40
Support / Object3D.getTransformedCenter().x returns NaN
« on: December 19, 2006, 01:04:47 pm »
I solved this. Sometimes current position of object was outside of start & end interval and the object due to formula went in wrong way until it finally reached Infinity and than i got NaN from getTransformedCenter()..

41
Support / Object3D.getTransformedCenter().x returns NaN
« on: December 13, 2006, 01:36:39 pm »
Code: [Select]

public static float getDefaultMovementSpeed(float start, float curr,
                                               float end, boolean fastTrans)
   {
      float speed =  getDefaultMovementSpeed(start, curr, end, fastTrans, 'c');
      if (Float.isInfinite(speed) || Float.isNaN(speed))
      {
         System.out.print("I produced NaN");
      }
      return speed;
   }


   public static float getDefaultMovementSpeed(float start, float curr,
                                               float end, boolean fastTrans, char aa)
   {
      if (Float.isInfinite(start) || Float.isNaN(start) ||
          Float.isInfinite(curr) || Float.isNaN(curr) ||
          Float.isInfinite(end) || Float.isNaN(end))
      {
         System.out.print("I got NaN from somewhere else");
      }
      float iOverallDistance = Math.abs(end - start);
      float iDistanceFromStart = Math.abs(curr - start);
      float iDistanceToEnd = Math.abs(end - curr);
      float negative = 1f;
      if (start > end) {
         negative = -1f;
      }
      if (iDistanceToEnd <= 3.5 || fastTrans) {
         return negative * iDistanceToEnd;
      }
      if (iOverallDistance <= 300) {
         if (iDistanceFromStart <= (iOverallDistance / 2f)) {
            return negative * (0.5f + iDistanceFromStart / 50f);
         }
         else {
            return negative * (0.5f + iDistanceToEnd / 50f);
         }
      }
      else {
         if (iDistanceFromStart <= 150) {
            return negative * (0.5f + iDistanceFromStart / 50f);
         }
         else if (iDistanceToEnd <= 150) {
            return negative * (0.5f + iDistanceToEnd / 50f);
         }
         else {
            return negative * (0.5f + 3f);
         }
      }
   }


I setted breakpoints at system.out... lines.. I think I may see than if this part of code produces NaN somehow. Now I just have to run it & wait when this creepy thing happens again. :)
Thanks for your help & time Egon

42
Support / How to rescale a object3D to a desired size.
« on: December 13, 2006, 12:14:24 pm »
Quote from: "radvani7"

The custom scaling worked out very well; I just multiplied a single-axis scale matrix with the rotation matrix, and set that composite matrix as the Object's rotation matrix.

Since I don't use the build-in scaling it doesn't cause any problems there!


is that it?

http://www.jpct.net/forum/viewtopic.php?t=341

43
Support / Object3D.getTransformedCenter().x returns NaN
« on: December 13, 2006, 12:02:31 pm »
Hello

I'm only translating & rotating objects (no animation is used), Actually objects are rotated only at begining, than the only manipulation done to them is tranlsate... they are also cloned, removed & added to world

I have two threads only. One is rendering thread, while another one pools the database for data. And only the rendering thread is accesing jpct classes.


This is where I calculate on every iteration for how much does the objects need to move. I don't see where i could produce NaN or Infinity value.
start... (x or y or z) coordinate, where object was at begining
start... (x or y or z) coordinate, where object is now
start... (x or y or z) coordinate, where object destination is
fastTrans... translate the object at finish at once.


Code: [Select]

   public static float getDefaultMovementSpeed(float start, float curr,
                                               float end, boolean fastTrans)
   {
      float iOverallDistance = Math.abs(end - start);
      float iDistanceFromStart = Math.abs(curr - start);
      float iDistanceToEnd = Math.abs(end - curr);
      float nagative = 1f;
      if (start > end) {
         negative = -1f;
      }
      if (iDistanceToEnd <= 3.5 || fastTrans) {
         return nagative * iDistanceToEnd;
      }
      if (iOverallDistance <= 300) {
         if (iDistanceFromStart <= (iOverallDistance / 2f)) {
            return nagative * (0.5f + iDistanceFromStart / 50f);
         }
         else {
            return nagative * (0.5f + iDistanceToEnd / 50f);
         }
      }
      else {
         if (iDistanceFromStart <= 150) {
            return nagative * (0.5f + iDistanceFromStart / 50f);
         }
         else if (iDistanceToEnd <= 150) {
            return nagative * (0.5f + iDistanceToEnd / 50f);
         }
         else {
            return nagative * (0.5f + 3f);
         }
      }
   }




PS. One thing more.. what happens to a float number if it reaches max value.. ???

44
Support / JPCT eats so much CPU and Memory
« on: December 11, 2006, 10:44:21 pm »
There can also be other reasons, like complex objects you are rendering (lot of polygons)...

45
Support / Streaming algorithm
« on: December 11, 2006, 05:47:24 pm »
Quote from: "radvani7"

The custom scaling worked out very well; I just multiplied a single-axis scale matrix with the rotation matrix, and set that composite matrix as the Object's rotation matrix.

Since I don't use the build-in scaling it doesn't cause any problems there!


Hm.. Don't really know how to do that  :? ...

Pages: 1 2 [3] 4 5