Hi everyone, 

I know this has been quiet for a while, but I figured it was a good time to 
think about merging in the basic framework for the model class. I think 
this work gets a lot more interesting with GL3+, but at least we can get 
some things worked out in the mean time. You can find my pull request here, 
and feedback would be greatly appreciated:
https://bitbucket.org/pyglet/pyglet/pull-requests/108/3dmodel/diff

This consists of a new pyglet.model module. The structure is very similar 
to pyglet.image. There is also a single codec for obj files, which was 
based on some older /contrib code. This codec is crude and unfinished, but 
works well enough for a placeholder. 

The pyglet.model.__init__ file contains the new `Model` class, as well as 
two Groups (for textured, or non-textured meshes). The main thing we need 
to flesh out is the `Model` class. In particular, which attributes we need 
to consider. Currently there is a `vertex_list_map`, which contains a 
mapping of the vertex lists and which Groups they are using (as some models 
have multiple meshes with different properties).

I'm thinking at the least we should add an `add_to_texture_bin` method, 
similar to Animations. This would also be useful for the resource module, 
so models loaded through there could optionally be added to the interal 
resource module texture bins (as Animations can be). 

I'm not an expert on these things, so any feedback is appreciated!

-Ben






On Tuesday, July 18, 2017 at 4:08:42 PM UTC+9, Nick Del Grosso wrote:
>
> Hi Benjamin, 
>
> That makes sense. Thank you for taking a look at ratcave! 
>
> Best wishes, 
>
> Nick 
>
> On Jul 11, 2017 10:24 AM, "Benjamin Moran" <benmo...@gmail.com 
> <javascript:>> wrote:
>
> As a follow up Nick, 
>
> You've recreated a lot of things that will potentially end up in pyglet 
> core at some point. This is more related to the other thread about an 
> eventual move of the pyglet codebase to GL3+. It looks like we can leverage 
> most of the existing pyglet.graphics module when we move forward with that, 
> so it makes sense for the Model framework to use the existing API for a 
> start.
>
> I see that you've written a nice obj loader, which is a lot cleaner than 
> the quick one I've hacked together :)
>
>  
>
>
> On Thursday, July 6, 2017 at 11:36:19 PM UTC+9, Nick Del Grosso wrote:
>
>> Hi Benjamin,
>>
>> Thank you for the compliment!
>>
>> Best wishes,
>> NIck
>>
>> On Thu, Jun 29, 2017 at 9:06 AM, Benjamin Moran <benmo...@gmail.com> 
>> wrote:
>>
>>> Hi Nick, 
>>>
>>> I was browsing through your code, and it looks like a nice project.
>>>
>>>
>>>
>>> On Wednesday, June 28, 2017 at 5:35:32 PM UTC+9, Nick Del Grosso wrote:
>>>>
>>>> Hi all,
>>>>
>>>> The ratcave package I wrote (https://github.com/neuroneuro15/ratcave) 
>>>> and use in my virtual reality research is exactly this.  
>>>>
>>>> Documentation and Tutorials:  
>>>> http://ratcave.readthedocs.io/en/latest/introduction.html#features
>>>>
>>>> Best wishes,
>>>>
>>>> Nick
>>>>
>>>> On Mon, Jun 19, 2017 at 4:29 AM, Benjamin Moran <benmo...@gmail.com> 
>>>> wrote:
>>>>
>>>>> I still plan on merging in the basic framework for Models, but first 
>>>>> I'm going over Steve's work on the documentation.
>>>>>
>>>>> Regarding loading the files, I realize we'll have to do something 
>>>>> regarding binary versus ascii formats. My initial thinking is that we 
>>>>> should default to loading as binary for everything, and just decode to 
>>>>> ascii inside the ModelDecoders if necessary. This would prevent a bit of 
>>>>> waste inside the load and resource methods. 
>>>>>
>>>>>
>>>>>
>>>>> On Friday, June 9, 2017 at 12:46:36 AM UTC+9, Benjamin Moran wrote:
>>>>>>
>>>>>> Other modules support loading resources from either a file object or 
>>>>>> just a filename, which the model one does as well. 
>>>>>>
>>>>>> The obj codec (so far) uses the os module to find the base path of 
>>>>>> the file object, and locates the other material and image files that way.
>>>>>>
>>>>>> There might be some hiccups that will pop up once trying to use the 
>>>>>> resource module, but nothing we can't solve. Any suggestions welcome, as 
>>>>>> always.
>>>>>>
>>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "pyglet-users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to pyglet-users...@googlegroups.com.
>>>>> To post to this group, send email to pyglet...@googlegroups.com.
>>>>> Visit this group at https://groups.google.com/group/pyglet-users.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "pyglet-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to pyglet-users...@googlegroups.com.
>>> To post to this group, send email to pyglet...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/pyglet-users.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
> You received this message because you are subscribed to the Google Groups 
> "pyglet-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to pyglet-users...@googlegroups.com <javascript:>.
> To post to this group, send email to pyglet...@googlegroups.com 
> <javascript:>.
> Visit this group at https://groups.google.com/group/pyglet-users.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyglet-users+unsubscr...@googlegroups.com.
To post to this group, send email to pyglet-users@googlegroups.com.
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to