ozRocker

Members
  • Content count

    832
  • Joined

  • Last visited

  • Days Won

    4

ozRocker last won the day on January 27

ozRocker had the most liked content!

1 Follower

About ozRocker

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://www.punkoffice.com

Profile Information

  • Gender
    Male
  • Location
    Melbourne, Australia

Recent Profile Visitors

2,927 profile views
  1. ozRocker

    Blender > .babylon Vertex Groups

    Just wondering, with the Blender export, is vertex order preserved?
  2. ozRocker

    Blender > .babylon Vertex Groups

    @babbleon you are awesome!! This is exactly what I need!
  3. ozRocker

    polygroups?

    I checked and it looks like groups are parsed in the OBJ importer public obj = /^o/; public group = /^g/; but "group" and "obj" will both create a new mesh //Define a mesh or an object //Each time this keyword is analysed, create a new Object with all data for creating a babylonMesh } else if (this.group.test(line) || this.obj.test(line)) { //Create a new mesh corresponding to the name of the group. //Definition of the mesh Maybe I can hack the OBJ importer to create array pointers to the groups. There's no animation here, but I want to avoid morph targets 'cos I want to manipulate the vertices mathematically
  4. ozRocker

    polygroups?

    Is it possible to define polygroups or vertex groups? I know Blender allows you to define vertex groups. Is there a way to include that info in the .babylon export? Basically I want to be able to manipulate bodyparts vertices (not armature)
  5. ozRocker

    Dancing in tracksuit pants

    Go ahead. Steal away! Maybe if I'm lucky @Deltakosh will put it on BJS demo page
  6. ozRocker

    Dancing in tracksuit pants

    Thanks mate! light.shadowOrthoScale fixed it
  7. ozRocker

    Dancing in tracksuit pants

    I just noticed that at certain angles, the shadows get cut off. Has anyone experienced that before?
  8. Another demo with fabric animation. Just some dude who's doing some cool dance moves. https://punkoffice.com/tracksuit/
  9. ozRocker

    How is vertex data stored from OBJ file?

    So would this be considered a bug?
  10. ozRocker

    How is vertex data stored from OBJ file?

    I see what's going on. This function here: var isInArrayUV = (arr: Array<{ normals: Array<number>; idx: Array<number>; uv: Array<number> }>, obj: Array<number>) => { if (!arr[obj[0]]) arr[obj[0]] = { normals: [], idx: [], uv: [] }; var idx = arr[obj[0]].normals.indexOf(obj[1]); if (idx != 1 && (obj[2] == arr[obj[0]].uv[idx])) { // <-- this comparison return arr[obj[0]].idx[idx]; } return -1; }; A position can be associated with multiple UV points. In my OBJ I have some pos/UV pairs: 98/99 and 98/440. When checking is 98/440 exists it will check arr[obj[0]].uv[idx] to see if there is a mapping between 98 and 440. The problem is, uv[idx] (idx always being zero) will only return the first UV associated with the position. So every time the parser encounters 98/440 it will incorrectly check it against 98/99, think its unique then add the 98/440 entry every time. This is why I'm getting duplicate entries.
  11. ozRocker

    How is vertex data stored from OBJ file?

    This is what's confusing me. I'm getting multiple entries when I swear the tuples should be unique. I can see it in the code: var _index; if (OBJFileLoader.OPTIMIZE_WITH_UV) { _index = isInArrayUV(tuplePosNorm, [ indicePositionFromObj, indiceNormalFromObj, indiceUvsFromObj ]); } else { _index = isInArray(tuplePosNorm, [ indicePositionFromObj, indiceNormalFromObj ]); } //If it not exists if (_index == -1) { but when I output to console I can see repeated entries. I'm trying to edit the position data so if I can at least figure out what conditions make the entries repeat, then I can pull it off
  12. ozRocker

    How is vertex data stored from OBJ file?

    That does help. Thank you! I can see this line: //Check if this tuple already exists in the list of tuples so it looks like the uniqueness comes from a combination of all 3 values.
  13. ozRocker

    How is vertex data stored from OBJ file?

    Yeh, I refer to the indices 'cos that's how the vertices are listed. If faces are set out like this: f 5/5/5 9/9/9 8/8/8 f 7/7/7 6/6/6 8/8/8 then the position data will contain the vertex at index 5, then index 9, then index 8, index 7, index 6. However, the last one will be ignored 'cos its already in the position data. So the vertices are stored according to the way the indices are listed in the face definitions.
  14. ozRocker

    How is vertex data stored from OBJ file?

    Thanks for that. I hadn't actually seen those pages before, but I had a read and unfortunately it doesn't help with my confusion. Basically I'm trying to find out what makes a vertex index appear multiple times in the position data.
  15. I'm referring to the list of vertices coming from this: mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); I used to think it would list the vertices referred to by the definition of the faces and that it was unique, so no vertices would appear more than once. for example, if you had this in the OBJ file: f 5/5/5 9/9/9 8/8/8 f 7/7/7 6/6/6 8/8/8 f 5/5/5 8/8/8 6/6/6 f 5/5/5 4/4/4 9/9/9 it would list 5th vertex, 9th vertex, 8th vertex, 7th vertex, 6th vertex, 5th vertex, then 4th vertex. Once a vertex is listed it will not appear again so repeated vertex indices are ignored. However, that does not seem to be the case here: f 90/90/90 91/91/90 92/92/90 f 62/62/62 77/77/77 61/61/61 f 77/77/77 79/79/79 61/61/61 f 61/61/61 79/79/79 60/60/60 f 93/93/91 94/94/92 95/95/93 f 96/96/94 97/97/95 95/95/93 f 90/98/96 98/99/97 99/100/98 The vertex at index 90 will appear from 90/90/90 then its repeated when we hit 90/80/96. So I'm thinking maybe its not just unique position index (90) but a combination of position and texture index (90/90/90 and 90/98/96). However, this is not the only case. There are other instances where vertex is repeated. I'm wondering if anyone knows exactly how they are listed and under which cases a vertex is repeated in the "getVerticesData" result.