I use these clases here for my personal 2D and 2.5D (3D, but only ever viewed from straight on) projects: https://bitbucket.org/snippets/HigashiNoKaze/7ndxM
It might work to have a Projection class with set and unset methods, which could be passed to the Window. This could be called automatically before and after draw. One issue is that sometimes you might want to reset this stuff during a draw call, such as for doing a 2D hud over a 3D background... I'm not sure of the best way to handle it, but I'll probably start by adding more extensive "camera" controls to my existing class, to use standalone. As for the actual 3D model transformations, I suppose it makes the most sense to put the transform calls inside a ModelGroup (based on how the Sprite class does it with SpriteGroup). This would allow setting any transform variables (x, y, z) on the model, and having it handled when the Group sets the state. It would be foolish to try to recalculate all of the Model's vertex lists to move it, but it might be useful to have a base offset parameter for when the image is loaded. This would allow loading in multiple models that are all based around 0, 0, 0, but you want to situate at different positions within the scene. On Tuesday, May 30, 2017 at 2:07:17 PM UTC+9, Richard Jones wrote: > > Hi Ben, > > That's great to hear. > > Projection (or rather, getting my model positioned and view configured to > display the model on screen ;-) is something that frequently stumps me when > I go back into OBJ modelling each time. It'd be awesome if there was a > reasonable default 3D projection (with an extended one that had some view > controls would be super). Having that code be highly modular and easy to > read would be a boon for newcomers. > > > Richard > > On 30 May 2017 at 14:10, Benjamin Moran <[email protected] <javascript:>> > wrote: > >> Thanks Richard, >> >> Batch support is definite. I actually hacked up a Sprite-module-like >> class based off of the /contrib code, which included both batch support as >> well as a direct Model.draw() method for people who like slow code :) >> >> Since you're here, what are your thoughts on projection? For my personal >> projects I have 2D and 3D fixed resolution viewport classes, which maintain >> aspect ratio on resizing. These are similar to the >> examples/fixed_resolution.py file. I gather from reading old discussions >> that something like this may have been planned for inclusion at some point. >> >> -Ben >> >> >> >> On Tuesday, May 30, 2017 at 12:43:20 PM UTC+9, Richard Jones wrote: >>> >>> +1 to make life easier, since OBJ is something I carry around between >>> projects. As long as the implementation has batch support :-) >>> >> -- >> 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 [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.
