advice before implementation

Started by Minigame, August 29, 2014, 01:51:23 PM

Previous topic - Next topic

Minigame

I'm rendering a multi player scene with jPCT and netty. I want to create a character design interface, but I'm not sure what the best way to swap a model on the fly..

Example:
Player entity is either set to male or female upon initialization. But it needs to be changable after init too... but it's not, yet.

class Player extends Object3D { ...
    super(Primitives.getPyramide(4.2f, 2f)); ...

    // what is the most efficient way to add an overlaying model and keep the pyramid from rendering or using necessary resources

EgonOlsen

If i got this right, i would prefer composition over inheritance in this case. If possible, make the player contain the Object3D that defines its view, don't make it inherit it. That way, you could simply swap the Object3D instance and keep the player instance.

Minigame

Quote from: EgonOlsen on August 29, 2014, 09:36:09 PM
If i got this right, i would prefer composition over inheritance in this case. If possible, make the player contain the Object3D that defines its view, don't make it inherit it. That way, you could simply swap the Object3D instance and keep the player instance.

Excellent concept! Thank you yet again Egon for your time!!! :D

AGP

By the way, if it's a character and you're using Object3D, I assume you'll be using vertex animation (presumably from MD2 models). Wouldn't you be better off with Bones?

Minigame

Quote from: AGP on September 02, 2014, 08:28:43 AM
By the way, if it's a character and you're using Object3D, I assume you'll be using vertex animation (presumably from MD2 models). Wouldn't you be better off with Bones?

Possible. I don't know / care anymore. I just paid a guy to create some consistent basic md2 models and use default jPCT code to render and animate them. Chances are I will be releasing this project open source very soon as I have completed all basic goals and I want to give back to the community, and let the project go. :)