Giter Club home page Giter Club logo

obj's People

Contributors

dependabot[bot] avatar javagl avatar msteiger avatar sibovg avatar yperess 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

obj's Issues

Obj with complex faces not loading correctly

Hey, I'm trying to debug this one... I've got an obj that I loaded from Google Poly where the faces aren't being drawn quite right. I think it has to do with the complex faces that it defines. If I find the fix I'll send a pull request but I figured you should know about it.
model.zip

object not loading correctly

Hi, I have been trying to learn to work with 3d rendering and was trying to load an obj file with your loader but it loads strangely. This is what it looks like when I render it.

I tried to render the same by breaking it into material groups and looping it. Now it's close to the real thing.It's still not perfect though.

when i load only one material group, the center oval should look like this,

but instead it looks like this. Do you have Any idea why this could be happening?

Obj#setActiveGroupNames() fails if used on an immutable collection

The method Obj#setActiveGroupNames() fails with a NullPointerException if used on a collection generated by Set.of() or List.of(). This is because those collections throw an exception if you try to test if they contain null, which you do when in the block:

else if (groupNames.contains(null))
{
    throw new NullPointerException("The groupNames contains null");
}

This is pretty annoying because if you're trying to add a face to only one group, that's what you'll be using 90% of the time.

Incorrect object normals

Hey, I'm not really sure this belongs in this library but I don't have a much better way to communicate with you. I found a model https://poly.google.com/view/eydI4__jXpi that does not contain normal vectors for one of the material groups. This makes the model render all black when computing the diffuse color since it's multiplied by the dot product of the face normal and the light direction.

screenshot_20180215-134713

This can be computed by calculating the normal of every face that a vertex is a part of and taking the average of these as the vertex normal. I added code to ObjUtils.convertToRenderable that does this but it's slow (about 21.5 seconds on a Pixel phone), even then I clearly did something wrong because the color isn't quite right (I'm still getting some black spots). Here's the commit to my branch where I added the code to inject normals: GoMeta@aefde24

device-2018-02-16-021113

Do you know if there's a better way to make sure that all the faces/vertices have the appropriate normals?

my Model stands head

Hi,

thank you for your Loader. Works fine,

but:

maybe you have an idea why my model stands head.
I am using the plain arrays from the ObjFile.
Another question would be: the parameter dimensions in the ObjData.getTexCoordArrays(obj, dimension) is for the format of my Texture Coordinates (in my case 2).

Thank you very much!

Large size obj's not loading its causes java.lang.OutOfMemoryError.

I have working ar-core android sample using your library to read obj files and render in opengl es.I have 200mb obj file its not read by simple wavefront loader library it causes the java.lang.OutOfMemoryError.But 110 obj files were read perfectly.is any to solve this problem?

MtlReader wrong parses at least map_Kd tag

Version 0.3.0, class MtlReader, line 160-161:

String mapKd = line.substring("map_Kd".length()).trim();
currentMtl.setMapKd(mapKd);

If line is "\tmap_Kd wood.jpg", we will get mapKd String value as a "d wood.jpg".
We must also cut "d "

The filename of mtllib written in the obj file is not used

On package de.javagl.jgltf.obj.model;
public class ObjGltfModelCreator
Method: public GltfModel create(URI objUri) throws IOException

  1. Initial

String mtlFileName = baseName + ".mtl";
URI mtlUri = IO.makeAbsolute(baseUri, mtlFileName);

  1. Reading obj file

Obj obj = readObj(objUri);

  1. Check exist of mtl file
    but, the filename of mtllib written in the .obj file is not used

if (IO.existsUnchecked(mtlUri))

osm to obj

may i know if this tool can convert osm file(open street map file) to obj?

Propose: support physically-based rendering parameters in de.javagl.obj.Mtl

In 0.3.0 supported mtl attributes are:
Ka - Ambient component
Ks - Specular component
Kd - Diffuse component
map_Kd - Diffuse map
Ns - Shininess
D - Opacity

can we introduce more support to mtl attribute, such as pbr attributes:
Pr/map_Pr # roughness
Pm/map_Pm # metallic
Ps/map_Ps # sheen
Pc # clearcoat thickness
Pcr # clearcoat roughness
Ke/map_Ke # emissive
aniso # anisotropy
anisor # anisotropy rotation
norm # normal map (RGB components represent XYZ components of the surface normal)

btw, I'ved add these attribute locally since I was developing a ar demo, and I'm willing to share my solution and create a mr, if possible.
is there any coverage standard or requirement if I want to contribute my solution.
Thanks

Is really need the initial value (kd, ks, ka) of DefaultMtl

Is really need the initial value (kd, ks, ka) of DefaultMtl ?
I think it should be possible to determine the case where no value is specified.

Current codes

DefaultMtl(String name)
{
    this.name = name;
    ka = new DefaultFloatTuple(0,0,0);
    kd = new DefaultFloatTuple(0,0,0);
    ks = new DefaultFloatTuple(0,0,0);
    ns = 100.0f;
    d = 1.0f;
}

private final DefaultFloatTuple ka;
private final DefaultFloatTuple kd;
private final DefaultFloatTuple ks;

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.