December 01, 2020, 06:27:31 PM

Author Topic: A question on texturing MD2 models in Blitz3d  (Read 1017 times)

Offline phodiS

  • Jr. Member
  • **
  • Posts: 52
A question on texturing MD2 models in Blitz3d
« on: May 11, 2018, 07:40:55 PM »
Hi guys,
           
      I need help with the following please. I have been looking around on google for hours and have come up empty.
      My problem is I can load and animate MD2 models into Blitz3d fine, but I can't get the pcx textures that came with the models to show up. I'm doing the following..
 

;HORSE
horse=LoadMD2("horse.md2")
PositionEntity horse,0,1,20
RotateEntity horse,0,180,0
ScaleEntity horse,.1,.1,.1
AnimateMD2 horse,1,1,32,46
tex=LoadTexture("horse.pcx")   <<< I also tried just loading a horse.jpg as a test and that doesn't show up either!..

      A quick solve would be if there is a Md2 to 3ds model converter around. And if there is, does anyone know what the program is called please.

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 480
Re: A question on texturing MD2 models in Blitz3d
« Reply #1 on: May 11, 2018, 08:39:16 PM »
PCX as texture files aren't supported in B3D (or BMax) so you need to convert the PCX to JPG/BMP/PNG then apply the texture manually. Usually you just use EntityTexture ent,tex.

If there are multiple surfaces and textures you can access each surface separately with GetSurface ent,1 and then BrushTexture brush,tex on the surface's brush to set the brush texture, I think you use LoadBrush first then PaintSurface after BrushTexture.

I'm not sure what converts MD2 to 3DS but the point of MD2 is the vertex-interpolation animation which is claimed to be the fastest when using many models. AFAIK, 3DS doesn't support this type of animation, it supports a simple hierarchy or keyframe-per-mesh animation, B3D supports boned/skeletal animation and X also supports hierarchy. You can also use ExtractAnimSeq to convert the animation data, which may be slightly faster.

Offline phodiS

  • Jr. Member
  • **
  • Posts: 52
Re: A question on texturing MD2 models in Blitz3d
« Reply #2 on: May 12, 2018, 04:41:59 AM »
Excellent!!!. THANK YOU... That is exactly what I needed to know to get me up and running.
While I'm at it, I have switched from a mesh painted terrain to a heightmap, and apart from putting one generic texture on the entire landscape, is there a way to ~paint~ a heightmap?. I have dabbled with applying textures at different heights on the map, but its not as nice as being able to add a personal touch.
Cheers.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal