Page 1 of 1

[Tutorial] Introduction with 3D and Purebasic

Posted: Sat May 19, 2012 11:53 am
by [blendman]
Hi

I have made a "basic" tutorial for Purebasic and the 3D (Ogre), here :
http://www.purebasic.fr/french/viewtopi ... 21&t=12782

It's in French, but if someone wants to translate it in English, Deutsch, or other langage, it would be really great ;).
My english isn't enough good to made this tutorial in English, sorry ;).


English Translation (made in google, But I think it's not very good) :
http://translate.google.fr/translate?hl ... 6t%3D12782

Deutsch :
http://translate.google.fr/translate?hl ... 6t%3D12782


I hope, it will be usefull for someone :)

Re: [Tutorial] Introduction with 3D and Purebasic

Posted: Sat May 19, 2012 12:48 pm
by void
At an initial glance-through, the google translated version is readable. I don't have time to go through the whole thing right now, but the bits I looked at were surprisingly clear. I mean, it's obvious it's machine translated, but I can follow it.

Re: [Tutorial] Introduction with 3D and Purebasic

Posted: Sat May 19, 2012 4:33 pm
by BasicallyPure
The code examples in the English translation got scrambled.
Here is an example from the 'Third Person' demo:

Code: Select all

; {Constants
# 60 = PlayerSpeed
# = 10 CameraSpeed
;}
That should be:

Code: Select all

; {Constants
#PlayerSpeed = 60
#CameraSpeed = 10 
;}
Parts of the code somehow got reversed.
There were many more problems in the 'English' version of the code, too many to mention.

I did try the 'Third Person' code from the French tutorial and it compiled and ran without errors.
Unfortunately the comments are not English.

B.P.

Re: [Tutorial] Introduction with 3D and Purebasic

Posted: Sat May 19, 2012 5:12 pm
by Andre
Even if I can't do much with 3D programming myself, this tutorial brings me to an idea:
What about adding a (short) introduction into 3D programming, means some basics and a start with using several commands/libraries of the Ogre command set included in PB, in this chapter
http://www.purebasic.fr/english/viewtop ... =7&t=45842 ??

Anyone with ideas? 8)

Re: [Tutorial] Introduction with 3D and Purebasic

Posted: Sun May 20, 2012 12:34 am
by void
BasicallyPure wrote:The code examples in the English translation got scrambled.
Yeah, that's to be expected.. The google language tools don't have a real working concept of contextual syntax.

When it comes to the code samples, one approach is to make use of the google language tools to translate just the comments. This is a bit of C&P, but it gets the gist across.

When I was looking over the document, I had both the original and the translated versions on separate tabs, so I could refer back to the original as needed.

Re: [Tutorial] Introduction with 3D and Purebasic

Posted: Sun May 20, 2012 10:17 am
by [blendman]
BasicallyPure wrote:The code examples in the English translation got scrambled.
In fact, the example is the same as the ThirdPersonn.pb from the example 3D (installed with Purebasic 4.60/6.61beta..)

You could find another version here :
http://www.purebasic.fr/english/viewtop ... 15&t=48108
Parts of the code somehow got reversed.
There were many more problems in the 'English' version of the code, too many to mention.
it's a google translation. It's not good, but, it's better than nothing.
I'm not a good translator, it's why I have ask if someone would like to translate this tutorial in English ;).

I did try the 'Third Person' code from the French tutorial and it compiled and ran without errors.
Unfortunately the comments are not English.
I have put the comments in english, in the french Version of tutorial.
So you can have the complete code (in the french version) with comments in English now.
What about adding a (short) introduction into 3D programming, means some basics and a start with using several commands/libraries of the Ogre command set included in PB, in this chapter
Hi Andre :).
I think it's a good idea :).


The basics commands could be :

1) Introduction of 3D with Purebasic
- introduction of 3D with Purebasic
- presentation of Ogre
- how to use it
- how can we do a game/demo with Pb (like in my tutorial, you can use it if you want ;))

2) initialisation
- init the engine : InitEngine3D() / AntialiasingMode(Mode)
- Add3DArchive("MyData.zip", #PB_3DArchive_Zip) / Add3DArchive("Data\", #PB_3DArchive_FileSystem)
- Parse3DScripts() : to load the scripts (material)

a) The mesh / entity / material
- LoadTexture() / CreateTexture()
- parameters of the material (DisableMaterialLighting, MaterialBlendingMode, ScrollMaterial...)
- advanced : GetScriptMaterial()
- LoadMesh() / CreateMesh
- CreateEntity()
- transform Entity : locate, scale, rotate..
- advanced : SetEntityMaterial()

Note for the material : a little chpater for the material (txt) should be usefull.

b) the lights
- Addlight()
- type of light : point, directionnal, spot
- light diffuse color, specular color, shadow

c) the camera
- CreateCamera()
- transformation of the camera : position (locate), rotation, fov, range...
- CameraLookAt()

d) The World
- ambient color
- Fog()
- skybox( ) / skydom()
- world mode : debug, wireframe
- world Shadow : none, modulative, additive, texture

e) 2 usefull fonction to create easily a demo
- createWater()
- createTerrain()

f) Billboards

g) Particle

3) The GUI
- Cegui fonctions
- Gadget3D

4) the advanced fonctions
a) node
b) Joint
c) collision / physic
d) static geometry
e) sound3D

5) Post Filters
- compositors

What do you think about that ?

Re: [Tutorial] Introduction with 3D and Purebasic

Posted: Sun May 20, 2012 8:04 pm
by Andre
[blendman] wrote: What do you think about that ?
It looks like covering all/most of the 3D stuff implemented in PB, if not even more... :o

So it seems, that there would be a lot to write: descriptions and example code, I think. I can't decide if it is already too much for an "introduction". Without any 3D knowledge it looks like it would be covering so much step by step, that even a totally beginner (like myself, who can't contribute something because of this reason) could learn using the 3D commands in PB this way...

I'm sure this would be a larger project, needing a lot of time for sure!? So we should give it the needed time - maybe creating it on the PB forum (where other people can contribute if they like) would be a good idea....
If it's ok to include in the PB manual (later, not for PB4.61 anymore) for all contributors, then that would be fine. :-)