Homebrew OBJ file loader with Citro3D?

YugamiSekai

Mr. Picross
OP
Member
Joined
Dec 24, 2014
Messages
2,015
Trophies
1
Age
21
XP
2,275
Country
United States
Is there a way we can load OBJ files in Citro3D C homebrew without having to type in each coordinate or is there a converter that converts OBJ files in C headers?
 

machinamentum

Well-Known Member
Member
Joined
Jul 5, 2015
Messages
163
Trophies
0
XP
549
Country
United States
I'm not aware of a OBJ->C converter that would work, but you can load OBJ files from SD or romfs. You can pull Model.cpp/Model.h from https://github.com/machinamentum/ModelViewer/blob/master/source/Model.cpp. That has an OBJ loader, but it'll only work if the OBJ being loaded is triangulated (has exactly 3 vertices for each face; there's a checkbox in Blender's exporter that will automatically do this for you). You'll have to do a small amount of work to convert the OpenGL-based rendering code to Citro3D, but the basic idea is there in order to do that (I dont have a code sample unfortunately as I havent yet used Citro3D).

Also keep in mind that if you're going to feed a vertex buffer to Citro3D, you probably will have to move the vertex data out of main memory and into the linear heap first.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Badcatalex @ Badcatalex:
    sony should #stopkillinggames
  • Badcatalex @ Badcatalex:
    they killed LittleBigPlanet online, which was the main core of every LBP game
  • BakerMan @ BakerMan:
    for real
  • BakerMan @ BakerMan:
    at least with them, it was because of the DDOS attacks, ubisoft was just scummy
  • BakerMan @ BakerMan:
    fuck ubisoft, and fuck activision
    +1
  • realtimesave @ realtimesave:
    Nintendo needs to release a new console, switch is getting such shitty little games lately lol it's pathetic
  • Purple_Heart @ Purple_Heart:
    Lmao a new flashcart... The Unlock Switch... I knew it's not fake xD
    +1
  • NinStar @ NinStar:
    A new consoles won't solve that problem
  • NinStar @ NinStar:
    It will actually make it worse
  • The Real Jdbye @ The Real Jdbye:
    well actually
    a new console won't do anything right now, because the games are still in development, that's why there are few games being released
  • The Real Jdbye @ The Real Jdbye:
    it won't make the games finish any faster
  • Veho @ Veho:
    2/3rds of launch titles for the Switch 2 will just be lazy ports of Switch games anyway.
  • The Real Jdbye @ The Real Jdbye:
    probably
  • The Real Jdbye @ The Real Jdbye:
    maybe mario kart 9 will be a launch title
  • The Real Jdbye @ The Real Jdbye:
    i really want a new mario kart
  • Veho @ Veho:
    What, you mean the endless stream of DLCs doesn't count?
  • Veho @ Veho:
    Why develop a new game when you can just sell season passes forever?
  • Veho @ Veho:
    I'm still on MKDS so I'm not bothered :tpi:
  • The Real Jdbye @ The Real Jdbye:
    i like the dlc tbh, i'd like a new game more
  • ZeroT21 @ ZeroT21:
    but the current version is still selling fine at full price
  • SylverReZ @ SylverReZ:
    Hello
  • ZeroT21 @ ZeroT21:
    sup
    +1
  • SylverReZ @ SylverReZ:
    @realtimesave, You seen the Unlock Switch flashcart yet?
  • K3Nv2 @ K3Nv2:
    I'll see the 19.0 update that blocks use ability to it
    +1
  • K3Nv2 @ K3Nv2:
    Lol newegg+
    Screenshot-20240423-053504-Gmail.jpg
    K3Nv2 @ K3Nv2: Lol newegg+