smart-fun / smartGL

SmartGL is a Graphic Engine for creating Android Games and Apps. It is based on OpenGL and handles 2D Sprites and 3D Textured Objects.
Apache License 2.0
109 stars 24 forks source link

java.lang.RuntimeException: Only triangles supported #4

Open haris15 opened 7 years ago

haris15 commented 7 years ago

i have an error while add my obj file instead of bus.obj

haris15 commented 7 years ago

please help me

smart-fun commented 7 years ago

Hello Haris and thanks for using smartGL.

SmartGL handles only objects made of triangles, so you have to convert your object first. You can try a tool like http://www.meshlab.net/ to re-export your object in Wavefront OBJ format.

When it is converted you should be able to use it with smartGL.

Arnaud.

ghost commented 7 years ago

try this:

cat my.obj | sed -E -e "s/f ([0-9\/]+) ([0-9\/]+) ([0-9\/]+) ([0-9\/]+)/f \1 \2 \3`echo -e "\r"`f \1 \3 \4/g" > my_tri.obj
haris15 commented 7 years ago

thanks i will try it

On Thu, May 18, 2017 at 10:15 PM, dawjdh notifications@github.com wrote:

try this:

cat my.obj | sed -E -e "s/f ([0-9\/]+) ([0-9\/]+) ([0-9\/]+) ([0-9\/]+)/f \1 \2 \3echo -e "\r"f \1 \3 \4/g" > my_tri.obj

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smart-fun/smartGL/issues/4#issuecomment-302467298, or mute the thread https://github.com/notifications/unsubscribe-auth/AbcSbtmiOcEnD9FVz_2aaW9JVtLtDFijks5r7HWMgaJpZM4NezM5 .

haris15 commented 7 years ago

please provide detail for your solutions

On Thu, May 18, 2017 at 10:15 PM, dawjdh notifications@github.com wrote:

try this:

cat my.obj | sed -E -e "s/f ([0-9\/]+) ([0-9\/]+) ([0-9\/]+) ([0-9\/]+)/f \1 \2 \3echo -e "\r"f \1 \3 \4/g" > my_tri.obj

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smart-fun/smartGL/issues/4#issuecomment-302467298, or mute the thread https://github.com/notifications/unsubscribe-auth/AbcSbtmiOcEnD9FVz_2aaW9JVtLtDFijks5r7HWMgaJpZM4NezM5 .

FonzTech commented 7 years ago

You can solve by importing your model in Blender, then exporting it ticking the "Triangulate Faces" option.