This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

Duta
Duta presents ...

2013/4/28

3D Model File Loader

So, MatheMagician made a similar scenario - http://www.greenfoot.org/scenarios/7931 - and a while ago I gave a rewrite of the file parsing algorithm in one of the comments. People started commenting on the scenario today, reminding me of it. Soo.... I made my own one. Enjoy. :)

EDIT: I realize that I should probably explain what this actually does:

In 3D modelling programs (such as Blender) you can export your creations to .obj files. What this does is parse that file and then re-creates your 3D art in Greenfoot.

C'est belle, non?

Controls:

W/A/S/D/Q/E => Move stuff around
Click & Drag => Rotate stuff

6443 views / 24 in the last 7 days

9 votes | 0 in the last 7 days

Tags: mouse game simulation physics demo with-source

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Sun Apr 28 21:17:03 UTC 2013 Better cube model.
A new version of this scenario was uploaded on Sun Apr 28 21:18:46 UTC 2013 Crash fix.
DutaDuta

2013/4/28

Fixed that crash JetLennit
DutaDuta

2013/4/28

(Thanks for reporting it!)
JetLennitJetLennit

2013/4/28

No problem =)
A new version of this scenario was uploaded on Sun Apr 28 21:25:00 UTC 2013 +Different head material, +Changed the shading intensity. Done for tonight, I think.
A new version of this scenario was uploaded on Sun Apr 28 21:28:12 UTC 2013 +Different head material, +Changed the shading intensity. Done for tonight, I think.
SPowerSPower

2013/9/15

Although this example doesn't have it, would it also be possible to load objects with textures instead of colors?
Alan_cAlan_c

2016/5/24

I'm getting parsing errors such as..... Error while parsing "f 19/46/5 25/45/5 26/47/5 21/48/5" in the file "models/Grave.obj". The file may not have parsed correctly. Error while parsing "f 21/48/5 26/47/5 5/8/5 2/7/5" in the file "models/Grave.obj". The file may not have parsed correctly. Error while parsing "f 17/49/5 16/50/5 23/51/5 27/52/5" in the file "models/Grave.obj". The file may not have parsed correctly. Error while parsing "f 27/52/5 23/51/5 3/10/5 8/9/5" in the file "models/Grave.obj". The file may not have parsed correctly............... I'm trying to use a model i've created but keep getting these error could you possibly help me out understand what i'm doing wrong looking at the code it says it has something to do with the faces if it starts with "f". Thanks very much in advance
RidicolasRidicolas

2016/11/25

how did you import the 3d models?

See all comments

Want to leave a comment? You must first log in.

Who likes this?

Kartoffelbrot SPower birdy FlyingRabidUnicornPig Game/maniac sametguzelgun Draymothisk Gevater_Tod4711 JetLennit