Git Product home page Git Product logo

defold-trenchfold's People

Contributors

astrochili avatar dlannan avatar marlowesmonkey avatar reanimatorxp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

defold-trenchfold's Issues

Merge convex shapes within an entity whenever possible.

Too many brushes with different textures along one wall create a large fragmentation of convex shapes.
But in fact they are one big convex shape.

It would be nice to merge convex shapes automatically when it's possible.

Dynamic entity rotates wrong when the dynamic body is without Rotation lock

It might be worth considering the idea of a separate compose, where each entity is in a separate gameobject. Each mesh and collision object should be located in its local center relative to its gameobject. This will allow us to move individual entities as needed, and dynamic objects will be handled correctly.

Add the content flag `decal`.

This flag should help to place brushes with decal faces along walls, and automatically place them to the minimum distance to the wall when exporting.

Not sure about the final implementation yet.

Add `collection` entity

Similar to a game object, it should be possible to place a collection file. In general, the implementation is most likely very similar to the current implementation of the game object.

Can't convert map to collection due to Windows encoding

First of all, converting the map file distributing within the github project works fine. However, when I open the map file in Trenchbroom (on Windows 10), save it and re-export the .obj file without any changes - I got an issue with the map conversion proccess:
image
There is nothing special, it happens due to Windows encoding: the re-exported .obj file has CR/LF instead of just LF. So, I made a change in a regex pattern in the utils.get_lines funciton to : '[^\r\n]+

function utils.get_lines(content)
...
  for line in content:gmatch '[^\r\n]+' do
    table.insert(lines, line)
  end
...

And now it works with both the CR/LF and LF line endings, on Mac and Windows.
Maybe it can help.

Generate vertices, normals and uv coordinates directly from the map file.

Now the script analyses an .obj file that contains ready-to-use vertices, normals and uv coordinates. This requires exporting the .obj from TrenchBroom every time the geometry is changed. It would be great to analyse the map itself to skip the export step.

This is an example of the brush:

// brush 104
{
( -144 -64 80 ) ( -144 -63 80 ) ( -144 -64 81 ) retro/TECH_4B 0 16 0 1 1
( -144 -64 80 ) ( -144 -64 81 ) ( -143 -64 80 ) retro/TECH_4B 0 16 0 1 1
( -144 -64 80 ) ( -143 -64 80 ) ( -144 -63 80 ) retro/TECH_4B 0 16 0 1 1
( -128 64 144 ) ( -128 65 144 ) ( -127 64 144 ) flags/unused 0 16 0 1 1
( -128 64 96 ) ( -127 64 96 ) ( -128 64 97 ) flags/unused 0 16 0 1 1
( -128 64 96 ) ( -128 64 97 ) ( -128 65 96 ) retro/TECH_4B 0 16 0 1 1
}

What does it mean:

(point_1) (point_2) (point_3) texture offset_x offset_y angle scale_x scale_y

The points generate a plane, not a face, we need to calculate the intersections of all the planes to produce vertices.

So we need to do three things:

  1. Generate vertices based on the planes.
  2. Generate normal vectors based on the planes.
  3. Generate uv coordinates based on offset_x, offset_y, angle, scale_x and scale_y values.

At the moment, I don't understand how to do any of these tasks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.