3D with Pharo and OpenGL ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

3D with Pharo and OpenGL ?

RIOU Judith

Hy,

 

I’m working at Thales for a year internship and I would like to do some OpenGL demos in smalltalk.  I’m searching a demo which shows the capacity to implement 3D drawing with Pharo. Does a demo already available on Pharo 3.0 ?

 

I aim to code my own demo and for example begin with a 3D drawing of the earth (earth texture and arcball camera).

 

Thanks.

 

Judith

[@@ THALES GROUP INTERNAL @@]

 

Reply | Threaded
Open this post in threaded view
|

Re: 3D with Pharo and OpenGL ?

kilon.alios
you can find plenty of code in Roassal3d that I think uses the NBOpenGL library here


NBOpenGL is basically a wrapper for OpenGL with Nativeboost. So if you are familiar with OpenGL , C and Nativeboost you are good to go using Roassal3d as an example to help you figure things out. 

I tried to make a set of tutorial but OpenGL proven very hard to tame. My main problem with my previous iMac was that Apple did not give error reporting for OpenGL which made it close to impossible to figure what went wrong with my OpenGL code. I have not tried to see if the situation improved with my new iMac that I purchased in the beginning of this year. 

Please note that previous iMac was 7 years old and still using Lion. 

Another tool that uses NBOpenGL is codecity. Bare in mind that OpenGL is pure graphics operation for the GPU so it does not provide with file loaders etc but I am sure using the tools I told you about you will fill in the gaps.


On Thu, May 22, 2014 at 6:11 PM, RIOU Judith <[hidden email]> wrote:

Hy,

 

I’m working at Thales for a year internship and I would like to do some OpenGL demos in smalltalk.  I’m searching a demo which shows the capacity to implement 3D drawing with Pharo. Does a demo already available on Pharo 3.0 ?

 

I aim to code my own demo and for example begin with a 3D drawing of the earth (earth texture and arcball camera).

 

Thanks.

 

Judith

[@@ THALES GROUP INTERNAL @@]

 


Reply | Threaded
Open this post in threaded view
|

Re: 3D with Pharo and OpenGL ?

stepharo
In reply to this post by RIOU Judith
Welcome Judith

Do not hesitate to ask more questions. I may visit brest 1-5 to June.

Guys we should really help judith because like that her boss can show how Pharo is cool
to his own boss :)

Judith you should look for a previous email of ronie (check the mailing-list archive)?
I cannot browse it right now (preparing emails in the train).

Stef


On 22/5/14 17:11, RIOU Judith wrote:

Hy,

 

I’m working at Thales for a year internship and I would like to do some OpenGL demos in smalltalk.  I’m searching a demo which shows the capacity to implement 3D drawing with Pharo. Does a demo already available on Pharo 3.0 ?

 

I aim to code my own demo and for example begin with a 3D drawing of the earth (earth texture and arcball camera).

 

Thanks.

 

Judith

[@@ THALES GROUP INTERNAL @@]

 


Reply | Threaded
Open this post in threaded view
|

Re: 3D with Pharo and OpenGL ?

Jean Baptiste Arnaud
In reply to this post by kilon.alios
There are also some basic examples in:
http://smalltalkhub.com/#!/~PharoExtras/NBOpenGL
NBOpenGL-Extra


On 22 May 2014, at 18:10, kilon alios <[hidden email]> wrote:

you can find plenty of code in Roassal3d that I think uses the NBOpenGL library here


NBOpenGL is basically a wrapper for OpenGL with Nativeboost. So if you are familiar with OpenGL , C and Nativeboost you are good to go using Roassal3d as an example to help you figure things out.

I tried to make a set of tutorial but OpenGL proven very hard to tame. My main problem with my previous iMac was that Apple did not give error reporting for OpenGL which made it close to impossible to figure what went wrong with my OpenGL code. I have not tried to see if the situation improved with my new iMac that I purchased in the beginning of this year.

Please note that previous iMac was 7 years old and still using Lion. 

Another tool that uses NBOpenGL is codecity. Bare in mind that OpenGL is pure graphics operation for the GPU so it does not provide with file loaders etc but I am sure using the tools I told you about you will fill in the gaps.


On Thu, May 22, 2014 at 6:11 PM, RIOU Judith <[hidden email]> wrote:

Hy,

 

I’m working at Thales for a year internship and I would like to do some OpenGL demos in smalltalk.  I’m searching a demo which shows the capacity to implement 3D drawing with Pharo. Does a demo already available on Pharo 3.0 ?

 

I aim to code my own demo and for example begin with a 3D drawing of the earth (earth texture and arcball camera).

 

Thanks.

 

Judith

[@@ THALES GROUP INTERNAL @@]

 





Best Regards
Jean Baptiste Arnaud







Reply | Threaded
Open this post in threaded view
|

Re: 3D with Pharo and OpenGL ?

Jean Baptiste Arnaud
In reply to this post by kilon.alios
there are also my crappy tools that I develop to understand the wavefront format:

It is able to load .obj file generated from blender and integrate some material.

It is really raw but it is with this tool that I import the Xwing model and beginning to debug material.



On 22 May 2014, at 18:10, kilon alios <[hidden email]> wrote:

you can find plenty of code in Roassal3d that I think uses the NBOpenGL library here


NBOpenGL is basically a wrapper for OpenGL with Nativeboost. So if you are familiar with OpenGL , C and Nativeboost you are good to go using Roassal3d as an example to help you figure things out. 

I tried to make a set of tutorial but OpenGL proven very hard to tame. My main problem with my previous iMac was that Apple did not give error reporting for OpenGL which made it close to impossible to figure what went wrong with my OpenGL code. I have not tried to see if the situation improved with my new iMac that I purchased in the beginning of this year. 

Please note that previous iMac was 7 years old and still using Lion. 

Another tool that uses NBOpenGL is codecity. Bare in mind that OpenGL is pure graphics operation for the GPU so it does not provide with file loaders etc but I am sure using the tools I told you about you will fill in the gaps.


On Thu, May 22, 2014 at 6:11 PM, RIOU Judith <[hidden email]> wrote:

Hy,

 

I’m working at Thales for a year internship and I would like to do some OpenGL demos in smalltalk.  I’m searching a demo which shows the capacity to implement 3D drawing with Pharo. Does a demo already available on Pharo 3.0 ?

 

I aim to code my own demo and for example begin with a 3D drawing of the earth (earth texture and arcball camera).

 

Thanks.

 

Judith

[@@ THALES GROUP INTERNAL @@]

 



Best Regards
Jean Baptiste Arnaud







Reply | Threaded
Open this post in threaded view
|

Re: 3D with Pharo and OpenGL ?

darrinm
In reply to this post by Jean Baptiste Arnaud
I am having trouble getting NBOpenGL to work. I started with the Pharo 3.0 image from (http://pharo.org/download) and registered/configured NBOpenGL from http://smalltalkhub.com/#!/~PharoExtras/NBOpenGL (ConfigurationOfNBOpenGL-RonieSalgado.18.mcz). The instructions there are a little confusing since they say:

In Pharo 2.0, current configuration should be loaded:
(ConfigurationOfNBOpenGL project version: '3.0') load.

But it seems meant for Pharo 3.0 and the latest configuration is version 3.1. Anyway, after loading version 3.0 on my Mac I can run the GLTTRenderingDemo (yay!). Wanting more I load NBOpenGL-Extra-jeanbaptistearnaud.3.mcz but the NBOpenGL-Extra Demos don't work for me.

For example, GLDemo01EmptyWindow opens a red window with a trace indicating that NBMSAAOffscreenDisplay(Object)>>doesNotUnderstand: #makeCurrent. If I comment out the render method's "(Smalltalk platform isMacOSX)" test then it works and displays a colored window.

Moving on to GLDemo02RedTriangle I get "MessageNotUnderstood: receiver of "on:" is nil" from the render method statement "program := NBGLProgram on: display gl.".

NBGLProgram doesn't seem to exist in NBOpenGL version 3.0 so I load version 3.1. NBGLProgram exists there but now GLTTRenderingDemo doesn't work any more ("MessageNotUnderstood: AnObsoleteNBGLFragmentProgram class>>on:") nor does the new GLTutorial1 ("Error during FFI call: nil" from shaderSource_shader:count:string:length:).

GLDemo01EmptyWindow (with isMacOSX test commented out) still works but GLDemo02RedTriangle fails with MessageNotUnderstood: NBGLProgram class>>on:

Advice? Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: 3D with Pharo and OpenGL ?

Jean Baptiste Arnaud
The main problem with openGL, is two group have been work in parallel.
When we merge the demo work on my version of NBGLProgram. 
And we keep the version of Roassal3D, the demo do not work anymore, I expected as the code has been change, the small demo have been ported too.
It is not working anymore sorry. 
I will spend time to fix that.

If you want to put energy in it. your are welcome. Should not be hard If you know the C openGL
The calls should be correct just the API and "how" it should be used have been change, NBProgram NBBuffer NBShader have been change so the demo code should be updated too...
By example the on: method do not exist anymore now we need to instantiate and set the stateTracker. 
I do not have a real internet connection.
I take a look when I have one.

On 26 May 2014, at 02:21, darrinm <[hidden email]> wrote:

I am having trouble getting NBOpenGL to work. I started with the Pharo 3.0
image from (http://pharo.org/download) and registered/configured NBOpenGL
from http://smalltalkhub.com/#!/~PharoExtras/NBOpenGL
(ConfigurationOfNBOpenGL-RonieSalgado.18.mcz). The instructions there are a
little confusing since they say:

In Pharo 2.0, current configuration should be loaded:
(ConfigurationOfNBOpenGL project version: '3.0') load.

But it seems meant for Pharo 3.0 and the latest configuration is version
3.1. Anyway, after loading version 3.0 on my Mac I can run the
GLTTRenderingDemo (yay!). Wanting more I load
NBOpenGL-Extra-jeanbaptistearnaud.3.mcz but the NBOpenGL-Extra Demos don't
work for me.

For example, GLDemo01EmptyWindow opens a red window with a trace indicating
that NBMSAAOffscreenDisplay(Object)>>doesNotUnderstand: #makeCurrent. If I
comment out the render method's "(Smalltalk platform isMacOSX)" test then it
works and displays a colored window.

Moving on to GLDemo02RedTriangle I get "MessageNotUnderstood: receiver of
"on:" is nil" from the render method statement "program := NBGLProgram on:
display gl.".

NBGLProgram doesn't seem to exist in NBOpenGL version 3.0 so I load version
3.1. NBGLProgram exists there but now GLTTRenderingDemo doesn't work any
more ("MessageNotUnderstood: AnObsoleteNBGLFragmentProgram class>>on:") nor
does the new GLTutorial1 ("Error during FFI call: nil" from
shaderSource_shader:count:string:length:).

GLDemo01EmptyWindow (with isMacOSX test commented out) still works but
GLDemo02RedTriangle fails with MessageNotUnderstood: NBGLProgram class>>on:

Advice? Thanks.




--
View this message in context: http://forum.world.st/3D-with-Pharo-and-OpenGL-tp4760029p4760343.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Best Regards
Jean Baptiste Arnaud







Reply | Threaded
Open this post in threaded view
|

Re: 3D with Pharo and OpenGL ?

darrinm
Thanks for the help. I'll try to get it working. I haven't found an example of instantiating a StateTracker or a StateTracker class.

Where is the version of Roassal3D that works with the latest NBOpenGL?
Reply | Threaded
Open this post in threaded view
|

Re: 3D with Pharo and OpenGL ?

darrinm
OK, I've found the R3StateTracker and am working from that.
Reply | Threaded
Open this post in threaded view
|

Re: 3D with Pharo and OpenGL ?

Jean Baptiste Arnaud
So the code has not been ported ... yet.
StateTracker is a Roassal3D mecanism, that should not been used in standards OpenGL.
Using R3StateTracker here introduce a dependency between NBOpenGL from Roassal3D that is really bad, as Roassal3D has one from NBOpenGL. 
The additional risk is to blur the line between OpenGL and Roassal3D.
But in curent state, I am not sure there another way.
My demo are completely deprecated because do not used the R3 entity at all. so do not used it, il will put energy to solve that. By reinvent the wheels.




On 27 May 2014, at 01:10, darrinm <[hidden email]> wrote:

OK, I've found the R3StateTracker and am working from that.



--
View this message in context: http://forum.world.st/3D-with-Pharo-and-OpenGL-tp4760029p4760466.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




Best Regards
Jean Baptiste Arnaud







Reply | Threaded
Open this post in threaded view
|

French OS

Annick Fron-2
On ne rigole pas …



Le 28 mai 2014 à 09:49, Jean Baptiste Arnaud <[hidden email]> a écrit :

So the code has not been ported ... yet.
StateTracker is a Roassal3D mecanism, that should not been used in standards OpenGL.
Using R3StateTracker here introduce a dependency between NBOpenGL from Roassal3D that is really bad, as Roassal3D has one from NBOpenGL. 
The additional risk is to blur the line between OpenGL and Roassal3D.
But in curent state, I am not sure there another way.
My demo are completely deprecated because do not used the R3 entity at all. so do not used it, il will put energy to solve that. By reinvent the wheels.




On 27 May 2014, at 01:10, darrinm <[hidden email]> wrote:

OK, I've found the R3StateTracker and am working from that.



--
View this message in context: http://forum.world.st/3D-with-Pharo-and-OpenGL-tp4760029p4760466.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




Best Regards
Jean Baptiste Arnaud