N3XTD: 3D engine

Developed or developing a new product in PureBasic? Tell the world about it.
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post by byo »

Wow, incredible work you're doing with this. I've never seen an easier-to-use engine like this one. And very fast too. Another plus is the documentation. Everything is well detailed there.

A couple of questions:

1) Are pointers the only way to program?

2) Is there a way to detect when the window is closing? I noticed many examples will only end when the user presses ESCAPE but will not end when the window is closed.

Anyway, you're doing such a fine job with this and I will probably what to use when I start my first 3D game.

Keep it coming. :D
Proud registered Purebasic user.
Because programming should be fun.
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

1) Are pointers the only way to program?
Yes, I thought at one time use ID, but that increasing the code and denatured performance.
The use of pointers is a habit, though not very frequent with PureBasic. ;)
2) Is there a way to detect when the window is closing? I noticed many examples will only end when the user presses
ESCAPE but will not end when the window is closed.
There are several ways to terminate an application.
If you want a clean close of the application by closing the window, it is sufficient to detect the window close event and
to call in this case of releases N3XTD.
For example, in the example 'Sample001Gadget.pb it is possible to close the window without crash the application. 8)

Anyway, you're doing such a fine job with this and I will probably what to use when I start my first 3D game.
Good news. As I often say, the project is only the beginning, and it will continue its way quietly and mature
over the coming months.
Strength and wisdom.
Image
Saboteur
Enthusiast
Enthusiast
Posts: 272
Joined: Fri Apr 25, 2003 7:09 pm
Location: (Madrid) Spain
Contact:

Post by Saboteur »

Amazing!
The engine is very complete and easy to use. Waiting for physics. :wink:
[:: PB Registered ::]

Win10 Intel core i5-3330 8GB RAM Nvidia GTX 1050Ti
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post by Inner »

Just updating info.

* 3DS (Passed No Errors) (Exported 3DS Max)
* LWO (Passed No Errors) (Imported 3DS from Max exported to LWO)
* OBJ (Loads the mesh but no texture)
* X (Failed, can't explain the mess it created over the mesh)

Code: Select all

;
*obj.IObject=iLoad3DObject("Acc.x")
If(*obj=#Null)
  Debug "iLoad3DObject() Failed"
EndIf
*boat=iCreateMesh(*obj)



Define *cam.ICamera = iCreateCamera( )
iPositionNode(*cam, 0,25,-50)
iRotateEntity(*obj,0,30,0)
Might want to check out what is going on there it coursed a crash.
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

-For OBJ format, Did you file '.mtl' with the file '.OBJ' ?

-Regarding the file format. X ', it is known that Irrlicht has a little compatibility problem with this standard.
That said, attention, Irrlicht only supports uncompressed. X file.

and for your code:

Code: Select all

Define *cam.ICamera = iCreateCamera( )
iPositionNode(*cam, 0,25,-50)
iRotateEntity(*obj,0,30,0)
wath iRotateEntity(*obj,0,30,0) ? (an inheritance of Dreamotion3D ?)

It would be better to write:

Code: Select all

Define *cam.ICamera = iCreateCamera( )
iPositionNode(*cam, 0,25,-50)
iRotateNode(*cam,0,30,0)
;)
Strength and wisdom.
Image
Machiavelli
User
User
Posts: 26
Joined: Sun May 24, 2009 2:38 pm

Post by Machiavelli »

hello.
i have two problems:
1. how to use shadows?

Code: Select all

*light.iLight = iCreateLight($ffffffff, 30)
      iPositionNode(*light, 0,70,-40)
      ICastShadowLight(*light, #True)
***
*plane.IMesh - iCreateHillPlane(20, 20)
*tank.IObject = iLoad3DObject("data\tank_body.3ds")
      *tank_body.IMesh =  iCreateMesh(*tank)
       iPositionNode(*tank_body, 0,0,0)
doesn't work. (i'm need cast tank shadows on plane)

2. why the model handle is displaced in the centre? (.3ds)
Image

(sorry, i'm don't speak english :) )
Last edited by Machiavelli on Mon May 25, 2009 3:48 pm, edited 3 times in total.
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

2.)Before doing an export with 3DSMax, it seems to me to do a "Reset XForm" from the menu 'Utilities'.

1.)With Irrlicht, shadows are available only with the animations, it is a choice made by the Irrlicht
(which might say questionable). But it's like that.
An alternative is to load a static model as if it was an animation, in which case you can enjoy the shadows.

But the shadow system of Irrlicht is very brief, it is ShadowVolume Software, therefore very heavy in resource,
and therefore it should be reserved solely for the animation or mesh and can light many.
Most advanced users of Irrlicht worked with shaders to produce their shadows.
This is one of the low points of this engine.

Code: Select all

; Include files 
IncludePath "includes"   :   IncludeFile "n3xtD_PB.pbi"

; Globales
Global	anglex.f, angley.f, flagXDown.w
Global	mox.f, omx.f, moy.l, omy.l
Global *app.l, Quit.l


;----------------------------------------------------------
; open n3xt-D screen
*app = iCreateGraphics3D(800,600)
; << OR >>
;*app = iCreateGraphics3D(800,600, 32, #False, #False, #EDT_DIRECT3D9)
If *app= #Null
  End
EndIf 
 
 
; set the curent folder
  SetCurrentDirectory("media/") 


;----------------------------------------
 ; load an 3D object 
  Global *obj1.IObject = iLoad3DObject("sphere.x")
  Global *obj3.IObject = iLoad3DObject("plane.3ds")


;----------------------------------------
; create traditional light and set position
Global *light.ILight = iCreateLight($ffaaaaaa, 80)
  iPositionNode(*light, 20,30,-30)
;----------------------------------------


;-----------------------------------------
; create plane
*plane.IMesh =  iCreateMesh(*obj3)
iScaleNode(*plane, 1.5,1.5,1.5)
iPositionNode(*plane, 0,-1.5,0)
;----------------------------------------


;--------------------------------------
; create first animation B3D
*sp.IAnimatedMesh = iCreateAnimation(*obj1)
iPositionNode(*sp, 0,5,0)
iRotateNode(*sp, 0,180,0)
iShadowVolumeAnimation(*sp)

;iShadowColor( $96000000)

;-----------------------------------
; create a camera
Define *cam.ICamera = iCreateCamera( )
iPositionNode(*cam, 0,15,-25)
iRotateNode(*cam, 15,0,0)

; ---------------------------------------
;           main loop
; ---------------------------------------
Repeat
  
	; if Escape Key, exit	
  If iGetKeyDown(#KEY_ESCAPE)
    Quit=1
  EndIf

  	; ---------------
  	;      Render
  	; ---------------
  iBeginScene(50, 50, 50)
     iDrawScene()
  iEndScene()


Until Quit=1
; end
iFreeEngine()
Strength and wisdom.
Image
Machiavelli
User
User
Posts: 26
Joined: Sun May 24, 2009 2:38 pm

Post by Machiavelli »

thanx :)
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

Well, after two weeks of coding, here is the first integration of the physics engine.

For the occasion, I chose an engine that I already knew, Newton.
But, I integrated the 2.01 version, not the old version 1.53.
No big revolution in appearance, but to dwell on them, the advances are important and significant.

For the moment, only the coded features of bases, nothing impressive, I add over time additional
instructions to manage the advanced features, such as vehicles, ragdoll and other ...


Links are always those of the original post.

The next areas of work are:
- Further work on the physics engine..

Image Image
Image Image
Strength and wisdom.
Image
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

Looking good ! You clearly have more time on yer hands than i have ! keep it up - am gonna check this out at the weekend a bit ;)
"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! ;)"
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

;)

The latest version (the 11) will be available Sunday.
And a new portal has been opened. 8) ( http://www.n3xt-d.org )
Strength and wisdom.
Image
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

N3XTD update ( the eleventh)
I have therefore taken account of some bugs and other shortcomings (eg antialiasing,
iFreeNode, etc ...)

Most of my work as promised, therefore, focused on 2D, so I included some instructions and created,
and to see how to do 2D, even if it does not equal time for the 'real' engine Dedicated 2D.
As an example, I write fast 2D two small programs in the form of a small simple game. The aim is
mainly to show what we can do and especially how.
The media are not top, but hey, I am quick with what I had on hand.
The yet to explore in 2D, the collisions, for the moment it is just testing positions, is very brief,
but it is an area to dig.

That said, N3xtD is still the basis of a 3D engine ;)

As against the 2D/3D mix can with some effort to find nice things for those who work.

For against, with OpenGL, I have some machines on one or two small yet annoying visual bugs,
I'm trying to see where it can come.


Links are always those of the original post, or on http://www.n3xt-d.org web site (download section).

The next areas of work are:
- Always a bit 2D
- Various routines to improve and add some functions.

Image
Strength and wisdom.
Image
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

Works GREAT so far. :D

Managed to compile under Linux ( had to grab the Newton Sources and build that first tho ).
All examples run so far.

However:
CreateMesh Example - onQuit ends with a crash on cleanup:
purebasic_compilation1.out: ../../include/IReferenceCounted.h:119: bool irr::IReferenceCounted::drop() const: Assertion `!(ReferenceCounter <= 0)' failed.

At the two 2d to 3d game examples the Spritefile for the Player is case-sensitive under Linux:
iCreateSprite3D("Space1.png", 100.0) - > File is named space1.png - minor thing.

btw. Did you implement the Animators ?

Good Stuff!
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
Psychophanta
Addict
Addict
Posts: 4997
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Post by Psychophanta »

It is great and heavy work!!
@Tmyke, however, since we (me & my team) use only Windows, please let us know if you reach to superate Dreamotion3D with N3XTD. :)
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

@Thalius: thx.
At the two 2d to 3d game examples the Spritefile for the Player is case-sensitive under Linux:
iCreateSprite3D("Space1.png", 100.0) - > File is named space1.png - minor thing.
Thank you, I'll fix that.
btw. Did you implement the Animators ?
Only animated textures yet. I think integrating the other possibilities in the future.

However:
CreateMesh Example - onQuit ends with a crash on cleanup:
purebasic_compilation1.out: ../../include/IReferenceCounted.h:119: bool irr::IReferenceCounted::drop() const: Assertion `!(ReferenceCounter <= 0)' failed.
It's strange. I do not have Linux, but I will ask if anyone on the forum French encounter the same kind of problem.


@Psychophanta:
I would say that the biggest concerns N3xtD compared to Dreamotion3D is speed.
The functions and capabilities with N3xtD are more numerous than DM3D but DM3D was much better optimized and thus allow heavier
scenes and more complex.
It is well known that the main defect of Irrlicht (from which N3xtD) is its low optimization.
This is one of the main axis of my work in the coming weeks, allowing N3xtD to make up for the delay on this.
I have already changed the code native Irrlicht with some codes from DM3D.
I think N3xtD reach maturity at the beginning of this autumn.
Strength and wisdom.
Image
Post Reply