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.


Topics - cintix

Pages: [1]
1
Support / Project texture down on ground and objects
« on: November 18, 2011, 09:26:59 am »
Hi people,

I'm trying to figure out howto draw a texture "mark like a circle" on location with the mouse on the ground and objects.
Is that possible ? anybody done something like that ?  I was thing to get the position to draw it like picking on Objects maybe,  and somehow projecting a texture down on anything below it. maybe blit ?

I hope this make sense  :-)



2
Support / Problem with Object picking
« on: November 18, 2011, 09:19:25 am »
Hi trying to do some object picking, like i readed about on the wiki.
Now it seems to work, until I move the Camera around, then it does not work anymore. It's like when the camera moved then, the positions are not valid anymore. it still uses old positions ? any Ideas ??


Code: [Select]
    //my Call
     pickingObject(mouseMapper.getMouseX(), mouseMapper.getMouseY());
    // My method
    private Object3D pickingObject(int mouseX, int mouseY) {
        SimpleVector direction = Interact2D.reproject2D3D(world.getCamera(), buffer, mouseX, mouseY).normalize();
        float distance = world.calcMinDistance(world.getCamera().getPosition(), direction, 10000);
        int[] res = Interact2D.pickPolygon(world.getVisibilityList(), direction);

        if (res != null) {
            System.out.println("YAHOO!"); // never happends since I compile the objects
            Object3D picked = world.getObject(res[1]);
            return picked;
        }
        if (distance != Object3D.COLLISION_NONE) { // works sometime
            Object[] objects = world.calcMinDistanceAndObject3D(world.getCamera().getPosition(), direction, 20000);
            Object3D object3D = (Object3D) objects[1];
            return (Object3D) objects[1];
        }
        return null;
    }

3
Support / Difference in position when building object and not builing them
« on: November 13, 2011, 07:29:29 pm »
Hi agian,

In my little test I loading 3 rather simple 3DS models.
I created them in one project and exported them one by one, so when I loaded them. They would be placed correctly just by loading them.
This worked great until i noticed that I did not call world.buildAllObjects(), and I thought that might be a good idea to get better performance.

Then after building all object then the models gets a placed wrong. NOT all wrong but the Y axis is of like 69 and 56 on another object.
Have anyone of you had this problem ??




4
Support / Wall's not being drawn...
« on: November 10, 2011, 08:48:57 am »
Hi everyone,

I'm fairly new to playing around with 3D, so sorry it my question is something that would have been self explaining.
I use one the examples from the wiki, to test my 3DS models to see how they preform, and I have created a simple house(it's around 1100 poly), and the looks great.

When i look throw the holes I made for the windows, then the walls inside the house are not being drawn ?? I added a screenshot's to explain what i mean.
I tried adjusting Config.maxPolysVisible and Config.farPlane, but with no luck.

BTW.. is there anyway to blur the render a bit, so its doesn't have so sharp edges ?

Uhmm the roofs shows, but where did the wall go ??


Here you can see the wall is there....





5
Support / Uhmm Poser models ?
« on: August 20, 2009, 05:30:44 pm »
Hi guys,

Just a quick question.
Have anyone of you had any luck, exporting Poser Models in any format, and then using them in JPCT ?

I own a Poser Pro edtion for my MAC, and it but great to use the models in JPCT.
I tried a few times, but I never went all that well. The amount of polys in the Poser models, seem to be HUGE.

Even if I increse the amount of visible Polys. Then it still does'nt seem right.  Only some of the figures seem to be showing.
Then there is the bit about all of the textures.

Well I would love to hear from you guys if you tried this.

Cintix

6
Support / Md3 and MD5
« on: June 21, 2009, 08:55:18 am »
Hey :)

Have anyone of you a trick to load the Quake models (MD3 or MD5) models in jpct. I can't see a way to do it in the com.threed.jpct.Loader.


7
Support / Help regarding loading a MD2 model
« on: June 16, 2009, 02:37:58 pm »
Hello people,

I have never played around with 3D before, I know java pretty well, but just never used it for graphics though.
I tried following the example from http://www.jpct.net/wiki/index.php/Loading_3ds_Models_from_Blender, to load a model.

All went ok, but then i changed the model to a MD2 model. I seems like it loads the model, and applying textures, and I can't seem to either size it correctly i think. The model looks very FLAT.

if its any help then I downloaded a Quake 2 model from http://www.polycount.com/models/quake2/, that i tried with.

Here is the my source code.


Code: [Select]

import com.threed.jpct.*;

import javax.swing.*;

public class HelloWorldSoftware {
    private String[] textures = {"sydney"};
    private String thingName = "sydney";
    private int thingScale = 1;//end
    private World world;
    private FrameBuffer buffer;
    private Object3D thing;
    private TextureManager tm = TextureManager.getInstance();

    public static void main(String[] args) throws Exception {
        new HelloWorldSoftware().loop();
    }

    public HelloWorldSoftware() throws Exception {
        world = new World();
        world.setAmbientLight(150, 150, 150);
        for (int i = 0; i < textures.length; ++i) {
            tm.addTexture(textures[i] + ".jpg", new Texture("res/" + thingName + "/"  + textures[i] + ".jpg"));
        }
        TextureInfo ti=new TextureInfo(tm.getTextureID(textures[0] + ".jpg"));
        thing = loadModel("res/"+ thingName + "/" + thingName + ".md2", thingScale);
        thing.setTexture(ti);
       
        world.addObject(thing);
        world.getCamera().moveCamera(Camera.CAMERA_MOVEOUT,100);
        world.getCamera().lookAt(thing.getTransformedCenter());
    }

    private void loop() throws Exception {
        buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_GL_AA_2X);
        buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
        buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
        while (!org.lwjgl.opengl.Display.isCloseRequested()) {
            SimpleVector place = new SimpleVector();
            buffer.clear(java.awt.Color.BLUE);
            world.renderScene(buffer);
            world.draw(buffer);
            buffer.update();
            buffer.displayGLOnly();
            thing.rotateY(0.02f);
            thing.rotateX(0.01f);
           
            Thread.sleep(10);
        }
        buffer.dispose();
        System.exit(0);
    }

    private Object3D loadModel(String filename, float scale) {
        Object3D temp = Loader.loadMD2(filename, scale);
        temp.build();
        return temp;
    }
}

I hope one of you have some time to give me a bit of help.

//Michael

Pages: [1]