Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How we use indices when vt or vn index is omitted. #61

Open
monguri opened this issue Nov 29, 2015 · 8 comments
Open

How we use indices when vt or vn index is omitted. #61

monguri opened this issue Nov 29, 2015 · 8 comments

Comments

@monguri
Copy link

monguri commented Nov 29, 2015

Hi syoyo.
Thanks for your project. I have referred your code for my project MGRRenderer.

I have one question for it.
In updateVertex(), you have not registered the normal value to normals in case normal index is omitted such as 1//3, this is same as textures, therefore it looks that indices exist only for positions but not for normals or textcoords in mesh_t

Therefore I have no way to use glDrtawElements of OpenGLES2 when normal and textcoords do not exist.

@syoyo
Copy link
Collaborator

syoyo commented Nov 29, 2015

You can just fill dummy value(or compute geometric normal) when normals.size() == 0 or texcoords.size() == 0, for example:

https://github.com/lighttransport/nanort/blob/master/example/main.cc

@monguri
Copy link
Author

monguri commented Nov 30, 2015

Thank you for reply!

I want to know the way when some face element is complete format i/j/k and another is omitted fomat i//k in same material group, too.

Is it the improbable?
Sorry, I don't know obj specification sufficientry.

@syoyo
Copy link
Collaborator

syoyo commented Dec 1, 2015

First, you should investigate .obj specification so that your .obj data is correct or not.

Then, it would be better to take a look at @chrisliebert's https://github.com/chrisliebert/sdlgl3-wavefront

@monguri
Copy link
Author

monguri commented Dec 4, 2015

I found obj specification.
The case such as f 1/2/3 1//4 2/3/5 is illegal.
The way to omit normal or texcoord have to be consistent.
http://www.cs.utah.edu/~boulos/cs3505/obj_spec.pdf
b1-16

I read renderer of chrisliebert too.

I very thank you for your replies.

@syoyo
Copy link
Collaborator

syoyo commented Dec 4, 2015

Cool! > spec.

And you can send PR of reporting error for such an inconsistent/illegal input.

@status-open-bounty
Copy link

status-open-bounty commented Jan 16, 2018

Current balance: 0.000000 ETH
Contract address: 0xcb504d1148762bdde4ccae779e8ec5e9c82706dc
QR Code
Network: Mainnet
To claim this bounty sign up at https://openbounty.status.im and make sure to update your Ethereum address in My Payment Details so that the bounty is correctly allocated.
To fund it, send ETH or ERC20/ERC223 tokens to the contract address.

@arash009
Copy link

@syoyo this bounty has no funds yet, we can allocate some SNT to it if its still a valid bounty.

@syoyo
Copy link
Collaborator

syoyo commented Apr 25, 2018

Ah, the posted bounty was just an testing purpose and invalid. We can remove it and allocate new valid bounty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants