So I'm not sure if I expect anyone to know about this stuff but I guess I can try asking.
I wanted to try making a 3d object from scratch so I started putting relevant functions together. There's a lot of stuff that can go wrong here so I thought I'd see what other people thought of the code. Is this, at all, on the right track?
task triangleTest() {
let path = GetCurrentScriptDirectory ~ "/Corridor/testure.png"; //sets the path for the texture (object can't be seen without it)
let obj = ObjPrim_Create(OBJ_PRIMITIVE_3D); //Creates the object
ObjPrim_SetPrimitiveType(obj,PRIMITIVE_TRIANGLEFAN); //Sets the type of 3D object (why does this even need to be set?
ObjPrim_SetVertexCount(obj,3); //Creates some vertices (I'll need these)
ObjPrim_SetVertexPosition(obj,0,0,0,0); //Some conspicuous vertex placement
ObjPrim_SetVertexPosition(obj,1,0,100,100);
ObjPrim_SetVertexPosition(obj,1,0,0,100);
ObjPrim_SetTexture(obj,path); //sets the texture
ObjPrim_SetVertexUVT(obj,0,0,0); //UV mapping
ObjPrim_SetVertexUVT(obj,1,10,0);
ObjPrim_SetVertexUVT(obj,2,0,10);
Obj_SetRenderPriorityI(obj, 20); //A render priority
Obj_SetVisible(obj, true); //Would suck if this ended up being a problem
ObjRender_SetPosition(obj,0,0,0); //Added this, just to be safe.
}
Also I tried editing the vertices of a mesh with ObjPrim_SetVertexPosition, and that didn't work. Is there anyway to edit meshes?
EDIT: I fixed the code above, Line 8 I only set 2 vertices on accident. I've now got something showing up.