Main Menu
Menu

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.

Show posts Menu

Messages - Pascal

#1
Support / Re: View a simple .3ds model
October 17, 2012, 03:20:16 PM
Thanks, an other browser and the Cube works. But importing my .3ds model still doesn´t work (the Applet loads and then there is only an empty window) and there is no Error-Message...

It is a free .3ds model that I have. Isn´t it so easy to show it in the applet as i thought? Or what´s going wrong?

The model I used: http://artist-3d.com/free_3d_models/dnm/model_disp.php?uid=2719&count=count

I´m new in 3d-programming and experiment a little bit to get to know how it works

Best Regards,
Pascal
#2
Support / View a simple .3ds model
October 17, 2012, 02:44:42 PM
Hello,
i just tested the HelloWorld Applet and it works well. But when I want to change the Object3D "box" from the given Primitives.getBox(...) to a 3D-model (commented Line below it), after compiling and opening the .html file, there is still the green Box shown and not my 3D-model. Also when I change the Primitives.getBox() to .getCube(15) there is still the green Box from the beginning and no Cube.

Why does this happen?

Thanks for your help,
Pascal


private Object3D box;

    private FrameBuffer buffer = null;
    private World world = null;

    private boolean alive = true;
    private boolean initialized = false;

    @Override
    // Initialize all components of the applet
    public void init()
    {

        world = new World();  // create a new world
        World.setDefaultThread( Thread.currentThread() );

        // Add some light to the scene
        world.setAmbientLight(0, 255, 0);


        // create a new buffer to draw on:
        buffer = new FrameBuffer( getWidth(), getHeight(),
                                  FrameBuffer.SAMPLINGMODE_NORMAL );

// the lines i´m talking about
//**************************************************       
       
        // Create the box:
        box = Primitives.getBox(13f, 2f);
//      box = Loader.load3DS("D:/Temp/Tele.3ds",1)[0];
        box.build();

//**************************************************   

        // add the box our world:
        world.addObject( box );

        // set the camera's position:
        world.getCamera().setPosition( 50, -50, -5 );

        // Look at the box:
        world.getCamera().lookAt( box.getTransformedCenter() );

        // Finished initializing.  Now it is safe to paint.
        initialized = true;

        // Start the main "Game Loop":
        new Thread( this ).start();
    }

    // Main Game Loop:
    @Override
    public void run()
    {
        while( alive )
        {
            // Have the box rotate:
            box.rotateY( 0.01f );

            // Tell the applet to repaint itself:
            this.repaint();

            // Sleep for a bit:
            try
            {
                Thread.sleep( 10 );
            }
            catch( Exception e )
            {}
        }
    }

    // Draw the scene:
    @Override
    public void paint( Graphics g )
    {
        // Make sure jPCT is finished initializing:
        if( !initialized )
            return;

        buffer.clear();   // erase the previous frame

        // render the world onto the buffer:
        world.renderScene( buffer );
        world.draw( buffer );
        buffer.update();

        buffer.display( g, 0, 0 );
    }

    // End the main game loop:
    @Override
    public void destroy()
    {
    alive = false;
    }
}
#3
I´m new in Applet-programming, so excuse me for that question... But i have to analyse the possibilities of the differen techniques before choosing one and i´m not sure if it is realizable with an applet that it is actualizing a "position" depending on data lying on a server... I don´t want a complete solution, i just need to know if i can do it with an applet.

Thanks!
Pascal
#4
I have positionData (Coordinates), that are actualized from another programm in a database and i have to show that actual "position" in the 3D-Animation... So I need a possibility to make "RealTimeChanges" e.g. of a moving point in that realization or that the Applet reads out the positionData stored on the server. (Therefore the idea of an solution like JSF uses with the data in the backround would be great)
Is that possible or can I only use the created Applet that is completely created while the "first" load of it?
#5
Oh, I´m Sorry! I meant WebApp, not WebService. I need an application that is completely on the server and that the User doesn´t has to download a file before using that 3D-Animation.
One way is the Applet, but is there a way to create this app like an JSF/JSP-Page? (With something like a Bean in backround that contains the 3D-content) Or is an Applet the only way to publish an 3D-Animation where the user has possibilities for interactions?

@EgonOlsen: Thats the example I used, but when I create the HelloWorld.jar the applet gets the Exception that my HelloWorld.class wasn´t found. How do I have to pack the HelloWorld Class? Is there a special packagePath or anything else that I have to regard?

@Hrolf: Thanks, I´ll look at it in detail tomorrow...

Thanks for your help,
Pascal
#6
Hello,
i need to create a 3D-Animation that can be called via the browser. I didn´t find any examples to create a WebService (.war) with jpct. Is it right that this isn´t possible?

The only way is via an Applet? Because of this I wanted to test the AppletExample (http://www.jpct.net/wiki/index.php/Applets) but I get the Error
"Laden: Klasse HelloWorld nicht gefunden
java.lang.ClassNotFoundException: HelloWorld"

I created the Class in an Eclipse-Project an exported it as .jar. But what is the internal path from the HelloWorld-Class. Do i have to choose a special packagePath or what else do I have to consider when creating this .jar. (All three files are in the same folder (HelloWorld.jar, jpct.jar & HelloWorld.html))

Best Regards,
Pascal