Author Topic: Trouble with 3D Objects  (Read 6502 times)

Emerald Nova

  • Newbie
  • *
  • Posts: 19
  • Karma: +2/-0
    • View Profile
    • Emerald Nova Games
Re: Trouble with 3D Objects
« Reply #15 on: January 18, 2019, 03:40:04 am »
Below is the blender file, textures, and obj export used to create the ZTP. I desperately want to solve this problem tonight. There muse be something I am doing incorrectly with making these models. Is there a stripped down version of a basic load a single 3D model code I can look at?

ponut64

  • Full Member
  • ***
  • Posts: 220
  • Karma: +22/-1
    • View Profile
Re: Trouble with 3D Objects
« Reply #16 on: January 18, 2019, 10:44:51 am »
Have a look at this.

There is indeed something wrong with your ZTP. My best guess as to the problem there are two things:
1. You may have not formatted the TGA files correctly. Using Paint.NET works for me.
2. Many (>4) polygons sharing a vertice is gonna* (probably OK but it can) cause problems, especially if said polygons are to be triangles. Look at the top and bottom of the ball. The system does not know how to share two verts stacked in the center, shared between 32 triangles. As a rule, don't allow that to happen. When making models, always format them in Blender as quads. Sometimes you will need triangles to express a shape, that's OK.

In this file main.c below, focus on line 109. that's where you change the model.
In addition, the ZT model loading demo was causing extra problems because it was trying to animate that model, causing vomit.


I'm sorry you are having so much trouble. Also pay attention to the size of the model. In the demo i provided, it's scaled up by 14 and also you can move closer or farther from it with UP and DOWN.
« Last Edit: January 18, 2019, 02:11:26 pm by ponut64 »

Emerald Nova

  • Newbie
  • *
  • Posts: 19
  • Karma: +2/-0
    • View Profile
    • Emerald Nova Games
Re: Trouble with 3D Objects
« Reply #17 on: January 19, 2019, 01:39:03 am »
You may very well have just saved my ass.

Using Paint.net to make .TGA's with 24-bit color depth and no compression gives me valid textures.

Exporting quad based blender objects to .obj Wavefront files with with materials named identical to said .TGA's allows me to use the model converter.

Using the model converter with 0 keyframes (for a still model) and the same scale as the corresponding line of code:
Code: [Select]
jo_3d_set_scale(14,14,14);
gives me a valid model that will actually display in your test program.

I will be taking your program apart on my stream tonight to figure out what is needed and what isn't and transferring the appropriate portions to my main code (with attribution.)

Thank you so much. Hopefully the first half of tonight's stream can serve as a guide for others here. I'll try to be as thorough as my understanding allows so others can follow along when they're starting out.

ponut64

  • Full Member
  • ***
  • Posts: 220
  • Karma: +22/-1
    • View Profile
Re: Trouble with 3D Objects
« Reply #18 on: January 19, 2019, 01:44:33 am »
Make sure the stream knows XL2 is a hero! Last thing, the model converter (as far as I know) expects 32-bit TGA files. Using 24-bit should make your colors wrong. Maybe not!

I'm glad I could help. And thank you for sticking around.

 

Sitemap 1 2 3 4 5 6 7 8 9 10