Autore Topic: Componente SGE e file di modellazione MD2  (Letto 464 volte)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.719
  • Ne mors quidem nos iunget
    • Mostra profilo
Componente SGE e file di modellazione MD2
« il: 14 Novembre 2013, 16:03:02 »
Vi riporto questa discussione apparsa nella M.L. ufficiale:


" Using the example program as a reference I was able to successfully
render one of its included md2 models. If anyone needs a very spartan
starter tutorial, my basic code looks like this:


Codice: gambas [Seleziona]
   ' Model array declared at beginning of Render module.
   Public Model[32768] As Md2Object

   ' Model loading procedure test (index 500 is arbitrary).
   Dim TempModel As Md2Model
   TempModel = Md2Model.Load(BasePath & "/model/test/md2test.md2")
   TempModel.Texture = LoadTexture(BasePath & "/model/test/md2test.jpg")
   Model[500] = New Md2Object(TempModel)

   ' Render command after OpenGL matrix has been set.
   Model[500].Draw

I've been having a hell of a time finding decent modeling software that
can export to the md2 format, as it is very old (though quite nice for
my needs). I created an untextured cube in Misfit Model 3D (1.3.7, stock
Kubuntu 13.10 repo) and exported it to md2, but my code raises sig 11
when it tries to execute the Draw method.

Does anyone have any insight into what modeling applications exist that
can export to md2 format? I'd love to learn Blender, but all the md2
export scripts I found failed. I think they were designed for older
versions. Maybe I should look for an old Blender version...or contact
the Nexuiz team. Any advice is appreciated, and to whoever wrote the sge
component, thank you.

Kevin Fishburne
"


" Misfit, Fragmotion, and Quake 2 Model Editor (native support)
Blender, Cenima 4D, and Studio Max (all with plugins)
Marvelous Designer (for character clothing development)

Checkout: https://dev.metaio.com/content-creation/3d-animation/format/md2/

GameDev ought to have some info as well....

Randall Morgan
"


" You should really stop using all these embedded arrays, and use normal
arrays instead ! :-)

--
Benoît Minisini
"


" Maybe the best will be to add another format more accurate with the current
technologies.

Fabien Bodard
"


" Yes, I do think adding support for newer model types would be good. Perhaps
even add support for models done in solid works....

Randall Morgan
"


" Thanks everyone. I'll give the mentioned programs a try and keep
investigating.

I looked up Blender's stock export formats on Wikipedia and the only one
that looks useful is X3D:

http://en.wikipedia.org/wiki/X3D
http://www.web3d.org/realtime-3d/x3d/what-x3d

Seems geared toward rendering in a web browser, although I don't know
why it couldn't be implemented outside of one. I searched the package
names for x3d and couldn't find anything. Maybe there's a lib out there
somewhere.

Kevin Fishburne
"
« Ultima modifica: 14 Novembre 2013, 20:07:06 da vuott »
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.719
  • Ne mors quidem nos iunget
    • Mostra profilo
Re: Componente SGE e file di modellazione MD2
« Risposta #1 il: 15 Novembre 2013, 09:00:56 »
...continua...


" I finally got one of the md2 export scripts for Blender (2.66.1) working (vedi allegato).
I modified the Md2Model example project to use my exported
test md2 as a replacement for its "bauul.md2" data file so you could see
it crash. I'm guessing it is because the test md2 has no textures, so
I'll try that next. The modified project is here:

http://eightvirtues.com/sanctimonia/misc/Md2Model.tar.gz

It crashes when the Draw method is executed.

--
Kevin Fishburne
"
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.719
  • Ne mors quidem nos iunget
    • Mostra profilo
Re: Componente SGE e file di modellazione MD2
« Risposta #2 il: 19 Novembre 2013, 13:04:23 »
...continua...


" Attached (vedi allegato) is an md2 model and texture exported from Blender. It loads properly into mm3d (Misfit Model 3D) and Quake Model Editor 0.91 (using Wine). It loads in GAMBAS and shows the same properties as a working md2 (bauul.md2), yet raises signal 11 when the Draw method is executed.

I've looked through the code for the Draw method in the cmd2model.c file of the gb.opengl.sge component (I don't know C sadly) and it looks relatively straightforward, though I can't imagine which line it's crashing on. Obviously the code is expecting something in my md2 file which isn't there, or there's something in the md2 file that the code was not expecting.

Kevin Fishburne
"
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.719
  • Ne mors quidem nos iunget
    • Mostra profilo
Re: Componente SGE e file di modellazione MD2
« Risposta #3 il: 23 Novembre 2013, 16:19:07 »
...continua...


" gb.opengl.sge was crashing because your model has only one frame. I
fixed the component in revision #5967 so that it does not crash, but
just draws the unique frame.

Now I don't have the crash anymore, but I don't see anything on the
screen... Can you try to make a model with two frames?

--
Benoît Minisini
"
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »