@@ -203,10 +203,13 @@ blow_your_head = Plot(
203203Wawefront format is widely used as a standard in 3D graphics
204204
205205You can import your model here. Only vertices and faces supported.\
206- ` Model.load_OBJ(cls, path , wireframe=False, **all_model_kwargs) `
206+ ` Model.load_OBJ(cls, path_or_url , wireframe=False, **all_model_kwargs) `
207207
208208You can find examples here [ github.com/alecjacobson/common-3d-test-models] ( https://github.com/alecjacobson/common-3d-test-models )
209209
210+ You might have to normalize(scale and etc.)each ` .obj ` sample differently \
211+ Only vertices and faces are supported.
212+
210213``` python
211214Model.load_OBJ(' beetle.obj.txt' , wireframe = True , color = white, position = (- 2 , 2 , - 4 ), scale = 3 )
212215```
@@ -299,7 +302,7 @@ import sys
299302import pygame
300303
301304from play3d.models import Model, Grid
302- from pygame_utils import handle_camera_with_keys # your keyboard control management
305+ from pygame_utils import handle_camera_with_keys # custom keyboard handling - moving camera
303306from play3d.three_d import Device, Camera
304307from play3d.utils import capture_fps
305308
@@ -323,8 +326,14 @@ put_pixel = lambda x, y, color: pygame.draw.circle(screen, color, (x, y), 1)
323326Device.set_renderer(put_pixel, line_renderer = line_adapter)
324327
325328grid = Grid(color = (30 , 140 , 200 ), dimensions = (30 , 30 ))
326- suzanne = Model.load_OBJ(' suzanne.obj.txt' , position = (3 , 2 , - 7 ), color = white, rasterize = True )
327- beetle = Model.load_OBJ(' beetle.obj.txt' , wireframe = False , color = white, position = (0 , 2 , - 11 ), scale = 3 )
329+
330+ # be aware of different scaling of .obj samples. Only vertices and faces supported!
331+ suzanne = Model.load_OBJ(
332+ ' https://raw.githubusercontent.com/OpenGLInsights/OpenGLInsightsCode/master/Chapter%2026% 20Indexing%20Multiple%20Vertex%20Arrays/article/suzanne.obj' ,
333+ position = (3 , 2 , - 7 ), color = white, rasterize = True )
334+ beetle = Model.load_OBJ(
335+ ' https://raw.githubusercontent.com/alecjacobson/common-3d-test-models/master/data/beetle.obj' ,
336+ wireframe = False , color = white, position = (0 , 2 , - 11 ), scale = 3 )
328337beetle.rotate(0 , 45 , 50 )
329338
330339camera = Camera.get_instance()
@@ -338,7 +347,7 @@ def frame():
338347 sys.exit(0 )
339348
340349 screen.fill(black)
341- handle_camera_with_keys() # we can move our camera
350+ handle_camera_with_keys() # to move our camera - walk, can be ignored
342351 grid.draw()
343352 beetle.draw()
344353 suzanne.rotate(0 , 1 , 0 ).draw()
0 commit comments