How to show a 3D Wavefront obj file in PB ?

Just starting out? Need help? Post your questions and find answers here.
raska
User
User
Posts: 13
Joined: Wed Sep 13, 2006 11:27 am

How to show a 3D Wavefront obj file in PB ?

Post by raska »

I need to know if there is some way to use any library or something to show a Wavefront *.obj file in solid, points and edges mode. At same time that it can be moved with the mouse in Zoom, Pan and rotate options.

Thanks
Last edited by raska on Sat Oct 06, 2007 6:20 pm, edited 1 time in total.
Xqerience2003
User
User
Posts: 10
Joined: Fri Oct 05, 2007 8:10 pm

Post by Xqerience2003 »

raska
User
User
Posts: 13
Joined: Wed Sep 13, 2006 11:27 am

Post by raska »

Thanks a lot but I am looking for a very small thing, My program is 100 k. big and only that library is more than 9 meg. :roll:

I am looking for something simple with only those few functions that I explained in my firt post. Something like the Total commander's wcpfrep32.wlx list 3D viewer that is 300 k. big or maybe another more simple thing. :D

Thanks anyway ;)
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

Actually the dll itself is about 1.2 megs. If thats till too much you could use this as a converter / loader.

Use Irrlicht to load your object file and dump vertex / Indice / UV Data to a custom file ( which you in the final exe could include via includebinairy or paste as text - depending how you store it - you could even compress that section using Pbs pack commands ). Then use the OpenGL include
from: http://www.purebasic.fr/english/viewtopic.php?t=28835
to create your lil viewer passing the vertex / Indice / UV data to OpenGL.

Basically this data is a bunch of Arrays.

This way you could easly make a few kb sized viewer (30kb + obj data) - or you can write your own OBJ importer using the Format description from here:
http://www.wotsit.org/download.asp?f=vi ... =244988950

as for Irrlicht: if your unsure how to extract Vertex Data etc from a model i can provide an example.

Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: How to show a 3D Wavefront obj file in PB ?

Post by Comtois »

raska wrote:I need to know if there is some way to use any library or something to show a Wavefront *.obj file in solid, points and edges mode. At same time that it can be moved with the mouse in Zoom, Pan and rotate options.

Thanks
May be you can use Deledto convert your Wavefront to Mesh ?
Please correct my english
http://purebasic.developpez.com/
raska
User
User
Posts: 13
Joined: Wed Sep 13, 2006 11:27 am

Post by raska »

Thalius wrote:Actually the dll itself is about 1.2 megs. If thats till too much you could use this as a converter / loader.

Use Irrlicht to load your object file and dump vertex / Indice / UV Data to a custom file ( which you in the final exe could include via includebinairy or paste as text - depending how you store it - you could even compress that section using Pbs pack commands ). Then use the OpenGL include
from: http://www.purebasic.fr/english/viewtopic.php?t=28835
to create your lil viewer passing the vertex / Indice / UV data to OpenGL.

Basically this data is a bunch of Arrays.

This way you could easly make a few kb sized viewer (30kb + obj data) - or you can write your own OBJ importer using the Format description from here:
http://www.wotsit.org/download.asp?f=vi ... =244988950

as for Irrlicht: if your unsure how to extract Vertex Data etc from a model i can provide an example.

Thalius
Wow, that sounds good, but very advanced for a PB newbie like me. :)
My program manage some *,obl files and read their vertex to manipulate them in a way that I need to get what I want. Although the program really don't need the *.obj simple player it would be a good addition.
My idea was that every time that the program get an *.obj file it could call to an own smal library or Procedure able to show the obj in an small window.

I just got amazed after to see what the italian guy made with those demos. I will check them slowly trying to understand what he does. :)

Thanks for all your help and fast response
raska
User
User
Posts: 13
Joined: Wed Sep 13, 2006 11:27 am

Re: How to show a 3D Wavefront obj file in PB ?

Post by raska »

Comtois wrote:
raska wrote:I need to know if there is some way to use any library or something to show a Wavefront *.obj file in solid, points and edges mode. At same time that it can be moved with the mouse in Zoom, Pan and rotate options.

Thanks
May be you can use Deledto convert your Wavefront to Mesh ?
For my own use maybe yes, but it is an extra work that I really don't want yo do. For all my friends that using the program really it would be a big issue, because they don't know how to do it.
I think I will study the Thalius suggest to see what can I do :)
Thanks anyway
Post Reply