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

Pages: 1 ... 129 130 [131] 132 133
1951
Projects / aptal karga (foolish crow)
« on: August 04, 2005, 06:21:25 am »
as rolz asked for useful ideas, here is one. i use it since my first viewer prototype and find very convenient

if you use xml for static configurations (ie. not changed during program run) this is a simple receipt to make it robust and light-weight

* use jibx to convert your xml file to a tree of java objects. this eliminates those regular xml parsing issues which are both painful and error-prone
* serialize your object tree to a file
* re-compile the classes that make the object tree (as jibx uses bytecode enhancement, after using it your classes gets fatter and you need jibx runtime in your classpath to use them)
* now you can de-serialize that file in your program and use it without jibx runtime
* dont forget to manually assign a serial version id to your serializable classes -as below- otherwise above will fail

another advantage of this method is, since jibx uses reflection, you can make your configuration classes very small: with no setters-getters and almost all fields final

the result is, you get rid of xml parsing code and have a pure type-safe configuration in very little space

Code: [Select]

public class SomeConfigurationClass implements java.io.Serializable {
    private static final long serialVersionUID = 999;  // 'manually' assign serial version id
   
    public final String aStringValue = null;
    public final SomeOtherConfClass aComplexConfValue = null;
    // no need even for a constructor
    //..
}


Code: [Select]
r a f t
cheers :wink:

1952
Projects / Technopolies
« on: August 02, 2005, 06:24:23 pm »
Quote from: "rolz"
btw, what is your progress with hair/cloth/grass/tree animation ? got any useful ideas to share  ? ;)

the mechanism for clothing, hair and other accessories is basicly complete. as i wrote in my thread all clothing -including skin color, make up etc- is based on generating textures on the fly. hair and other mesh based accessories (glasses, earing etc) depend on animations saved via max-script to text files

if i dont break or change something (i will for sure :wink: ) it is a matter of modelling and configuration

i'm now working on terrain structure and a simple LoD (level of detail) mechanism for performance reasons. i will write in detail when completed

what is that grass/tree animation btw ?
Code: [Select]
r a f t

1953
Projects / Re: a screenshot
« on: August 02, 2005, 05:50:53 pm »
Quote from: "rolz"
Crawling through the evergreen forest ...
:)

to be honest, i really admire your shots.. they seem great
Code: [Select]
r a f t

1954
Projects / Technopolies
« on: August 01, 2005, 06:36:59 pm »
Quote from: "EgonOlsen"
Quote from: "raft"

btw, sometimes forum engine doesnt notify about replies
Works for me all the time...couldn't possibly be your spam filter or something?

no it isnt filtered as spam. maybe gmail is down for that moment and forum engine doesnt retry it  :?:

1955
Projects / Technopolies
« on: July 31, 2005, 08:12:51 pm »
Quote from: "EgonOlsen"
Depending on how you are implementing the collision detection, this may cause trouble IMO. Imagine entity A on client a move towards entity B (standing still on a) and entity B on client b moves towards A (standing still on b). Locally, this is no problem. On a, you correct the movement of A to not run into B and on b, you correct B's movement to not run into A. a and b are then sending the result back to the server. But then, A and B may cover the same space.
Have a look:

another example that causes the same problem occurs when both A and B tries to move to the same empty point P

i did use this approach in karga. clients may also use collision detection for movement of other players, this solves the 'unwanted intersection problem' but client states may differ a bit. not a problem for a '3d chat' but may be considered a slight problem in a game. anyway since its unlikely to happen, i find it negligable even for a game

in fact my server doesnt now anything about the 3d world in clients. it only stores a few necessary information about users, like their location, direction and current node

if the user moves with keyboard, one have to calculate movement stuff for every frame (as opposed to movement with mouse, which employs path finding) and those calculations cannot be done in server in an internet application (due to network lags)

looking this way, it is obvious that clients must maintain their own states. maybe some correction stuff can be deployed depending on the application type. for instance, in 3d chat, it is important who a user looks at so correction may depend on this

anyway, as i said before i find this somewhat negligable and low priority stuff

Code: [Select]
r a f t
btw, sometimes forum engine doesnt notify about replies

1956
Support / how to blit jcomponents?
« on: July 27, 2005, 03:06:09 pm »
Quote from: "EgonOlsen"
I just can't contribute to this thread...all i'm getting when i'm using Swing are grey rectangles... :oops:

who cares ? as long as you support jPCT  :wink:
Code: [Select]
r a f t

1957
Support / how to blit jcomponents?
« on: July 26, 2005, 05:37:30 pm »
Quote from: "rolz"
nope, they are not layered at all. JLayeredPane could not be used with AWTGLCanvas as it is a heavyweight component and will supress all other lightweight components on a layered pane.

not exactly. it is true that if you mix awt and swing components, awt components will show up at the top independent of their layers. but you can still use JLayeredPane and layering if all your components are awt (heavy weight) components.

i thought you were doing this, thats why i asked
Code: [Select]
r a f t
i'm afraid Egon will kick our asses as this is not a swing-awt forum :roll:

1958
Support / how to blit jcomponents?
« on: July 26, 2005, 03:48:53 pm »
Quote from: "rolz"
technopolies uses AWT gui elements. The only sad thing about this approach is that you cannot use transparency for awt elements (thus limited only for rectangular shapes) which are displayed on top of AWTGLCanvas.

so how do you layer them, in a JLayeredPane ?

1959
Support / Re: how to blit jcomponents?
« on: July 26, 2005, 12:53:39 pm »
Quote from: "robby"

But how could i add a JTextField in my scene.

i used a JLayeredPane to show such components. at the bottom layer is my graphics component and on top of that there are may others: panels, text fields etc

as Egon said, that way you are stuck to software renderer since you cant mix awt and swing components in a JLayeredPane. if you do, independent of their layer, awt component show up at the top (heavy vs light-weight stuff)

it effects the performance somehow but it works even for a quite complicated gui which is impossible or very hard to implement with blitting

Code: [Select]
r a f t

1960
Support / active rendering with AWTGLRenderer
« on: July 24, 2005, 12:37:18 pm »
yes, it did help. opengl renderer initializes both with 16 and 0  :D

thx
Code: [Select]
r a f t

1961
Projects / aptal karga (foolish crow)
« on: July 23, 2005, 05:20:03 pm »
yes, i did use octrees. as in fps demo, i simply merge objects to a single one, create the octree from result and then assign it. didnt help much

glVertexArrays makes a slight difference on a ~20000 poly scene

Code: [Select]
r a f t

1962
Support / active rendering with AWTGLRenderer
« on: July 23, 2005, 05:10:47 pm »
yes, it is still a Voodoo3. neither fullscreen nor windowed mode works. there is also a strange thing here, GraphicsDevice.isFullScreenSupported() returns false and hence i cant switch to fullscreen mode via GraphicsDevice. but lwjgl demos runs fine in fullscreen mode, and an attempt to enable OpenGL renderer first switches to fullscreen mode then comes back

OpenGL renderer first was complaning about DRI (direct rendering interface) wasnt enabled, so i installed mesa, set my desktop resolution to 1024x768x16 and enabled DRI. then it begun to complain about videomode.

despite my desktop color depth is 16 bits, all VideoMode's returned by FrameBuffer.getVideoModes() use a 24 bit ZBuffer depth. may this be the answer ?

i tried these in linux only. win xp supports full screen via GraphicsDevice
Code: [Select]
r a f t

1963
Support / active rendering with AWTGLRenderer
« on: July 23, 2005, 05:43:26 am »
the only solution i can think of is to use:
Code: [Select]

SwingUtilities.invokeAndWait(new Runnable() {
    public void run() {
        canvas.paint(someGraphics);
    }
});

instead of canvas.repaint(). but one can easily fall into deadlock trap and spend hours with java debugger as i did :evil:

is there any other way ?
Code: [Select]
r a f t

1964
Projects / aptal karga (foolish crow)
« on: July 23, 2005, 05:34:21 am »
* switched to active rendering
* after some tests, it is obvious animation loop performs better than a timer. switching part by part
* added a simple sky box
* dressing and accessories now persist among sessions (for registered users only)
* made an avatar tool for potensial 3d artists. this will help seeing all his/her work on avatar in a single place

i've also made some performance tests with AWTGLRenderer. for small worlds it is far more faster than software renderer, but as the world gets bigger the difference gets smaller. strange

    better with a sunny day. summer came to karga :wink:

Code: [Select]
r a f t

1965
Support / active rendering with AWTGLRenderer
« on: July 22, 2005, 07:59:44 pm »
hi,

how can one do active rendering with AWTGLRenderer. such an animation loop doesnt cause Canvas to be painted immediately
Code: [Select]

Canvas canvas = frameBuffer.enableGLCanvasRenderer(IRenderer.MODE_OPENGL);
//..
while(running) {
    world.renderScene(frameBuffer);
    world.draw(frameBuffer);
    //..
    canvas.repaint(); // this wont make the canvas to be painted immediately, but later
}

if canvas.repaint() is replaced with
Code: [Select]

canvas.paint(someGraphics);

this also fails since animation loop doesnt run in AWT-Thread's context. If we run these in AWT-Thread then we block the AWT-Thread and cause AWT and Swing events not to be dispatched. i looked for a method to dispatch all waiting AWT events and return but couldnt find.

so what is the solution ? i'm missing something i guess

and one more thing: although GLCanvasRenderer initializes fine on my box, OpenGL renderer doesnt. it complains about the VideoMode. (i tried all available modes FrameBuffer.getVideoModes(..) returns) lwjgl demos also work fine. i find this strange since  both GLCanvasRenderer and OpenGL renderer uses lwgl

thx
Code: [Select]
r a f t

Pages: 1 ... 129 130 [131] 132 133