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

Pages: [1] 2
1
Support / Re: Suggestion: calcmindistance
« on: December 05, 2009, 10:39:09 am »
it works, thank you!

PS: sorry for the late response, short break from work the last week ;)

2
Support / Re: Creating 3D objects at runtime?
« on: December 05, 2009, 10:14:24 am »
you could dynamically generate a perlin noise map or load a greyscale bitmap and displace the terrain vertices based on that map, however, that doesn't change anything about the basic terrain creating as shown by EgonOlsen.

3
Support / Re: obj world
« on: December 01, 2009, 01:53:27 pm »
http://www.jpct.net/wiki/index.php/Loading_models

this should help you, just make sure the names of the texture in the texturemanager correspond to the one in your obj file.

4
Support / Re: Suggestion: calcmindistance
« on: November 30, 2009, 03:18:16 pm »
ah ok, that was my main reason for the suggestion. Because now I execute calcmindistance, store all the objects I get an event on in a vector, loop through that vector and calculate the distance again to get the closest one. Result: the distance to objects had to be calculated twice (a nice bottle neck for larger scenes), hence the suggestion :).

5
Support / Suggestion: calcmindistance
« on: November 29, 2009, 11:29:37 pm »
Wouldn't it be easy if the code for calcmindistance would return the distance and the object related to that distance? That would make picking much easier (and less lines of code)

Code: [Select]
public float calcMinDistance(SimpleVector paramSimpleVector1, SimpleVector paramSimpleVector2, float paramFloat)
  {
    Object3D localObject3D = null;
    float f1 = 3.4028235E+38F;
    for (int i = 2; i < this.objectList.size(); ++i)
    {
      localObject3D = this.objectList.elementAt(i);
      if ((!(localObject3D.isPotentialCollider)) || ((!(localObject3D.isMainWorld)) && (localObject3D.oneSectorOnly) && (Config.useFastCollisionDetection) && (localObject3D.hasBoundingBox) && (localObject3D.rayIntersectsAABB(paramSimpleVector1, paramSimpleVector2, true) >= paramFloat)))
        continue;
      float f2 = localObject3D.calcMinDistance(paramSimpleVector1, paramSimpleVector2, paramFloat);
      if (f2 >= f1)
        continue;
      f1 = f2; <- save object
    }    if (f1 != 3.4028235E+38F)
      return f1; <- return array of object and distance
    return 1.0E+012F;
  }

just a suggestion ofcourse

6
Support / Re: compiled objects
« on: November 29, 2009, 09:08:00 pm »
perfect thanks, I was somewhat afraid I would have to use the GLU, but this is much cleaner :)

7
Support / Re: compiled objects
« on: November 29, 2009, 06:12:45 pm »
nvm, just saw in the javadoc that picking doesn't work on compiled objects. Any idea how i can get the same functionality using some other functions?

8
Support / compiled objects
« on: November 29, 2009, 06:07:03 pm »
Hey, me again, still doing modifications on that project. Hit a snatch though, whenever I compile an object Interact2d code will give problems (I need to compile the objects to use shaders btw)

For example, following code will still work:

Code: [Select]
//naar 3d coordinaten
    SimpleVector position = new SimpleVector(Interact2D.reproject2D3D(
            camera, buffer, x, y));
   
    //naar world space coordinaten
    position.matMul(camera.getBack().invert3x3());
    position.add(camera.getPosition());
   
    SimpleVector direction = position.calcSub(camera.getPosition()).normalize();
    float distance = world.calcMinDistance(position, direction, 10000);
   
    SimpleVector collisionPoint = new SimpleVector(direction);
    collisionPoint.scalarMul(distance);
    collisionPoint.add(position);
   
    if ((e.getModifiers() & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK)
    {
   
    if(distance != Object3D.COLLISION_NONE)
    {



It will report a collision, however, when I request the ID of the polygon that has been hit the result is null
Code: [Select]
position = new SimpleVector(Interact2D.reproject2D3D(
                camera, buffer, x, y));
        int[] is = Interact2D.pickPolygon(world.getVisibilityList(), position, Interact2D.EXCLUDE_NOT_SELECTABLE);
        int t = Interact2D.getObjectID(is);

Any idea what is going wrong?

9
Support / Re: Blox Builder
« on: November 22, 2009, 09:53:31 am »
Thanks for all your trouble, I really appreciate the builds you made!

I'm just going to make two applets, one that determines the capabilities and launches the complete builder with the correct parameters. Sounds like the best thing to do to make both intel chipset owners and nvidia/ati users happy :).

Thanks again, a final link for your project page is coming your way and I'll make use of the JPCT framework in the future too. When I find time I'll even try to contribute to the wiki ;)

10
Support / Re: Blox Builder
« on: November 21, 2009, 07:18:02 pm »
ps: i don't have an intel chipset (always careful not to buy one of those :p) so I have to ask a friend to test it.

11
Support / Re: Blox Builder
« on: November 21, 2009, 07:17:04 pm »
I've uploaded the latest version of jwgl, jpct and the applet to the same link:

http://www.freedownloads.be/bloxsystemsapplet/test.html

The jars are not obfuscated.

12
Support / Re: Blox Builder
« on: November 21, 2009, 06:31:49 pm »
I changed the applet to version 2.2.1 this morning, so it should be using that.

With the normal jpct jar I used before the message is as follows:

[ Sun Nov 21 15:38:18 CEST 2009 ] - ERROR: No support for WGL_ARB_multisample

With the one you gave me this afternoon and lwjgl 2.2.1:

[ Sat Nov 21 16:49:53 CET 2009 ] - ERROR: Unable to recover: No support for WGL_ARB_multisample

I guess it's hopeless :)

Any idea why just recreating the buffer in the ipaintlistener isn't working?

13
Support / Re: Blox Builder
« on: November 21, 2009, 04:54:36 pm »
hmmmm, another error:

Java version is: 1.6.0_17
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Using LWJGL's AWTGLCanvas
Software renderer disposed
Loading Texture...textures/floor_select.jpg
Loading Texture...textures/floor.jpg
Loading Texture...icons/turn_right_over.png
Loading Texture...icons/turn_left_over.png
Loading Texture...icons/turn_right_over.png
Loading Texture...icons/turn_left_over.png
Loading Texture...icons/lookdown.png
Loading Texture...icons/lookup.png
Building octree for 8192 triangles!
Octree constructed with 1 nodes / 1 leafs.
Adding Lightsource: 0
Adding Lightsource: 1
[ Sat Nov 21 16:49:44 CET 2009 ] - ERROR: Unable to recover: No support for WGL_ARB_multisample
Loading Texture...from Image
[ Sat Nov 21 16:49:52 CET 2009 ] - ERROR: Unable to recover: No support for WGL_ARB_multisample
[ Sat Nov 21 16:49:52 CET 2009 ] - ERROR: Unable to recover: No support for WGL_ARB_multisample
[ Sat Nov 21 16:49:52 CET 2009 ] - ERROR: Unable to recover: No support for WGL_ARB_multisample
[ Sat Nov 21 16:49:52 CET 2009 ] - ERROR: Unable to recover: No support for WGL_ARB_multisample
....

14
Support / Re: Blox Builder
« on: November 21, 2009, 12:12:06 am »
Code: [Select]
@Override
public void startPainting()
{
        if (GLContext.getCapabilities().GL_ARB_multisample)
        {
        System.out.println("Reinit for multisample");
        buffer.dispose();
       
        // create a new buffer to draw on:
            buffer = new FrameBuffer(RENDERWIDTH, RENDERHEIGHT, FrameBuffer.SAMPLINGMODE_GL_AA_4X);
            buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
            buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
           
            rendercanvas = buffer.enableGLCanvasRenderer();
            rendercanvas.setBackground(new Color(34,34,34));
            rendercanvas.setSize(RENDERWIDTH, RENDERHEIGHT);
        }

buffer.setPaintListener(null);

        new Thread(this).start();
}


something like this i guess, but it doesn't work yet. No errors, but also no rendering to be seen :)

15
Support / Re: Blox Builder
« on: November 21, 2009, 12:05:29 am »
I would happily ignore the error if those forementioned crapsets would render anything, however they don't fall back to normal mode.

I'll try to start in normal mode, do one repaint, ask for the capabilities in the paintstarted method and reinitialize the buffer according to the result. Should work i guess?

Pages: [1] 2