Author Topic: advice before implementation  (Read 2836 times)

Offline Minigame

  • int
  • **
  • Posts: 55
    • View Profile
advice before implementation
« on: August 29, 2014, 01:51:23 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: advice before implementation
« Reply #1 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.

Offline Minigame

  • int
  • **
  • Posts: 55
    • View Profile
Re: advice before implementation
« Reply #2 on: August 30, 2014, 12:13:46 am »
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

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: advice before implementation
« Reply #3 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?

Offline Minigame

  • int
  • **
  • Posts: 55
    • View Profile
Re: advice before implementation
« Reply #4 on: September 03, 2014, 10:35:39 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. :)