IrrlichtWrapper 1.05 (still) beta

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

I am using Purebasic v4.00. does the examples and the wrapper require a certain version of purebasic? what version of purebasic should i be using?
Personally i am using it with 4.02 :)
1) is there a way to change textures on the fly for different football players? for instance let's say i want to use the same football player model for all the football players. how would i put different numbers on the player's jerseys, make players skin different colors etc. but use the same model? or use the same football player model for two different teams, but use different colors for each team's uniforms, etc.

2) same thing for the football field- how can i change the textures for end-zone for each team, etc.
Of course you can change Textures on the Fly ( even create virtual cameras that would follow your players and display that inside the Stadion on a projector screen and so on ... :) Best check the Examples: Imagechanger and Render to Texture for that.

To characters i have to say theres some planning involved if you want really good and dynamic results. Theres several approaches. The basic approach is to use one texture for the whole model and animate it via bones ( this is how quake 2 did it with their md2 format ) - this allows you to swap the entire model texture for different looks .. not very dynamic but easy to manage. The second method would be to define the 4 hardware given materials you have smart on the model ( skin, clothing, number .. etc. ) and adjust for example a skintonechnage the diffuse and or ambient values for the material - this allows with a simple basic colourlayer to set seamlessly any skincolour in a simple RGB Value. For the player number you could use a simple 2nd layer on the clothing. the third and most complex method would be to export the bodyparts as own models and group them together and then connect em with Joints and animate em with Bones ( this also would allow for decapitation including physics etc .. but this kind of splatter would prolly more fall into Drac's genre :lol: - unless playing football with ahead anyone ? ) :twisted:
the last method needs some serious model construction planning but total freedom later on - meaning you can even adjust the bodyparts for every character with a few simple parameters ( with, height, slimness etc. ). But lemme tell you this - i would start with a simple approach until you get a hang of it - as good character animation is one of the toughest things still - and one can find themselves loosing grey hair on it - altho Irrlicht gives you all the possibilities to do also the advanced stuff - but the understanding how it works is important :) Id start with the 4 Material Method as it would allow you to change some of the model details at least.

Examples for advanced Character Animation and such are in the queue but theres alot more which needs to be finished first ( the Function Manual for example :roll: )

EDIT: You may want to look at this tool for Animating.
http://www.misfitcode.com/misfitmodel3d/main.html
And more info about Characters -> MD3 from Quake3 here:
http://misfitcode.com/misfitmodel3d/olh ... modeltypes

And Another Excellent Tutorial for Blender (http://www.blender3d.org) and Character Animation.
http://wiki.blender.org/index.php/BSoD/ ... _Animation

Happy Coding,
Thalius
Last edited by Thalius on Fri Aug 24, 2007 4:28 pm, edited 1 time in total.
"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! ;)"
Mike Yurgalavage
Enthusiast
Enthusiast
Posts: 118
Joined: Thu May 17, 2007 8:35 pm
Location: USA

Post by Mike Yurgalavage »

I am going to post my experience with the examples and write down any relevant problems or things that i experienced while running them.

my computer is INTEL Core Duo T2600 at 2.16 GHz with 2.00 GB Ram with a NVIDIA GEFORCE 7900 GTX video card.

I am running PureBasic 4.00

Here is the example and what happened.

EXAMPLE 1:

White screen with Hello World in upper left corner. Seems to compile and run correctly=

EXAMPLE 2:

yellow screen with several rectangular images in place along top and bottom of screen in various states of alpha, etc. Seems to compile and run correctly-

EXAMPLE 3:

black screen with SIMPLE MONOCHROME FONT written in white. Seems to compile and run correctly-

EXAMPLE 4:

"girl" model animating on a white background. Appears to compile and run correctly-

EXAMPLE 5:

castle like map loaded and can move with mouse and arrow keys. Seems to compile and run correctly. NOTE: there should be a key added to end the example as i had to alt-tab out and use Task Manager to end the example!

EXAMPLE 6:

purebasic billboard on white background. Seems to compile and run correctly. NOTES: once again, difficult to end the example, can a key be mapped to end the example? Also, hard to tell the effect of the billboard since there is nothing else in the background to compare the billboard to in order to see it's affect.

EXAMPLE 7:

small brick square with grey smoke particles emitting out on black background. seems to compile and run correctly. Had to alt-tab to end program.

EXAMPLE 8:

female in the castle and shadows on ground and also in parts of her body/face from light. Seems to compile and run correctly. Alt-tab again to end.

EXAMPLE 9:

mountains and sky "skybox" seems to operate correctly! alt-tab to end

EXAMPLE 10:

shows terrain with fog effects with white background and can move with arrow keys. Seems to compile and run correctly.

EXAMPLE 11:

shows 5 purebasic boxes on white background doing various types of animations. seems to compile and run correctly.

EXAMPLE 12:

move around in castle with arrows and mouse. collision with map seems to work correctly!

EXAMPLE 13:

move around in castle with arrows and mouse. values shown in white on upper left corner. seems to compile and run correctly!

EXAMPLE 14:

move around in castle with arrows and mouse using key and mouse events to capture the keyboard and mouse. kind of confusing at first to see what was going on here, but appears to compile and run correctly.

EXAMPLE 15:

see a triangle mesh with a white material with black lettering on it on a white background and can move around with mouse and arrow keys around the object. Seems to compile and run correctly! NOTE: white material or texture makes this hard to see against the white background.

EXAMPLE 16:

white lettered name on girl character on a grey background and can move the mouse and keys to move around her. Seems to compile and run correctly!

EXAMPLE 17:

does not run. Error reports:

Line 51: IrrAddTestSceneNode() is not a function, array, macro or linked list.

stops execution at line 51 below where arrow is pointing:

Code: Select all

If Irr3DRequester()

  ; send the window caption
  IrrSetWindowCaption( "Example 17: Selecting Nodes with the Mouse" )
  
  ; load the bitmap font as a texture
  *BitmapFont = IrrGetFont ( "media\bitmapfont.bmp" )
  
  ; load the test cube texture
  *MeshTexture = IrrGetTexture( "media\texture.jpg" )
  
  ; itterate all of the test nodes
  For i = 1 To #TEST_NODES
      ; add a test node to the scene
-->   *TestNode(i) = IrrAddTestSceneNode()
      
      ; move the node so that it is arranged into a square grid
      yy.l = ((i-1)/5)*20
      zz.l = ((i-1) % 5)*20    
      IrrSetNodePosition( *TestNode(i), 00, yy,zz )
  
      ; apply a material to the node
      IrrSetNodeMaterialTexture( *TestNode(i), *MeshTexture, 0 )
  Next i
i see no command in the help called IrrAddTestSceneNode() but i do see one for:

IrrAddTextSceneNode(*font.l, text.s)

but this is a TEST node not a TEXT node or maybe it was misspelled?

that's all the testing i can do for now. i do the others when i get time. also, i like to work out why example 17 won't compile. i did not touch the code at all, just load and compile and it gives this error-


best,
Mike
Godai
Enthusiast
Enthusiast
Posts: 171
Joined: Thu Oct 05, 2006 8:13 pm

Post by Godai »

IrrAddTestSceneNode was changed inside Irrlicht itself to IrrAddCubeSceneNode (not sure about exact name). Since the test node was a box, it didn´t really make sense to keep it :)
Mike Yurgalavage
Enthusiast
Enthusiast
Posts: 118
Joined: Thu May 17, 2007 8:35 pm
Location: USA

Post by Mike Yurgalavage »

Godai wrote:IrrAddTestSceneNode was changed inside Irrlicht itself to IrrAddCubeSceneNode (not sure about exact name). Since the test node was a box, it didn´t really make sense to keep it :)
thanks for the quick reply. so we change it to:

IrrAddCubeSceneNode() with no parameters does not work. Wonder why they left it coded like this if this is no longer supported and also it requires parameters!

at any rate, IrrAddCubeSceneNode(10) does work (as in example 18 ). i finish testing the other examples later. they might want to read my feedback and fix/improve these things within these examples.

thanks again for this wonderful wrapper! i am getting excited at the power of it!

best,
Mike
Godai
Enthusiast
Enthusiast
Posts: 171
Joined: Thu Oct 05, 2006 8:13 pm

Post by Godai »

You have to specify the unit size of the cube :)
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

@Mike Yurgalavage:

Thanks! very helpful ! :D
The white or black objects hint mostly for lacking textures and or wrong paths.
i am going to fix a corrected version - there seem to be a few Textures missing for the Billboards :shock: - will add them to the SVN again and update the download.

ps. Am sorry if you didnt get a reply from mails or Pms yet - i have this queue working down and my human brains multitasking currently is scheduling several projects.... :lol:

EDIT: Ok, Examples seem to run fine ( textures etc are ok also ) altho theres a bug in the GUI Functions - we are on it.

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! ;)"
krensauce
User
User
Posts: 18
Joined: Sun Nov 05, 2006 10:24 pm

Post by krensauce »

Ah btw for anyone having problems quitting demos, use ALT+F4 . That's the default key combination to quit all applications.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4326
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

[ESC] worked in the earlier version of PB, I haven't tried the demos with 4.02 yet as I am waiting for ogre improvements of trying to unravel the HGE Engine I need to use with it!
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
T-Light
User
User
Posts: 45
Joined: Sat Aug 05, 2006 5:42 pm
Location: UK

Post by T-Light »

Hi guys, excellent work on this. :D

Found a couple of bugs I don't think have been mentioned so far.

28_Example_RenderToTexture.pb

Line 82 >

Code: Select all

    *RenderTarget = IrrCreateRenderTargetTexture(256,256)
Works fine :) , but if you increase the texture resolution to over 512,512 the texture no longer appears in the DX9 engine. The OpenGL engine is fine with this. Even with very large textures, eg

Code: Select all

    *RenderTarget = IrrCreateRenderTargetTexture(4096,4096)
.

27_Example_LoadFromMemory.pb

This one's a lot more serious, It can result in crashes and can take the pb interface down with it. Initially it would just highlight line 149 >

Code: Select all

  IrrStop()
with an invalid memory access warning, some times no warning comes up, other times, as I say, it takes out the interface.

Anyway, enough with the problems, terrific work here guys, really looking forward to 1.6 :D


--------------------------------
Vista Premium
2.0 Ghz Dual Core laptop
2GB memory
NVidia 7600 256MB gfx
T-Light
User
User
Posts: 45
Joined: Sat Aug 05, 2006 5:42 pm
Location: UK

Post by T-Light »

:?: Questions to Thalius or Neotoma (or anyone who may know)

I've been looking at the '24_EmbeddedIrrlicht.pb' example. While it's easy enough to add the maximise or minimise code within pb for the window, is there an irrlicht command to resize the irrlicht viewport within the window?

Should say I don't care about calculating the new size of the viewport to suit, that should be easy enough, I'd just like to know if it's possible to resize the irrlicht viewport on the fly?

-------------------------------------------------

Second question. Is there a way of writing data directly to the texture memory? ie, is there a way of finding out image width/height/depth then writing to the texture memory for fast texture manipulation?

I'm looking at a load of 3D engines at the moment and while there isn't anything out there that can do everything I want, this latest port of Irllicht is amazingly close, Thanks again :D
neotoma
User
User
Posts: 84
Joined: Sun Dec 14, 2003 6:38 pm
Location: Germany, Mechernich
Contact:

Post by neotoma »

T-Light wrote:Is there an irrlicht command to resize the irrlicht viewport within the window?
Well, undocumented, but there are something :

Code: Select all

    IrrSetViewPort(x1.l, y1.l, x2.l, y2.l)
    IrrGetViewPort(*x1.l, *y1.l, *x2.l, *y2.l)
[/quote]
You can use this also for Widescreen-like scenes.
 [quote="T-Light"] Is there a way of writing data directly to the texture memory? ie, is there a way of finding out image width/height/depth then writing to the texture memory for fast texture manipulation?
[/quote]
Not at the Moment, but planned.

Mike
T-Light
User
User
Posts: 45
Joined: Sat Aug 05, 2006 5:42 pm
Location: UK

Post by T-Light »

Wow, thankyou Mike, very fast response, I'll try that out tonight.

On the texture front, is there a reasonably fast way of copying the irrlicht texture to a free memory area, altering the data, then copying back? I might be able to get away with that.

Thank you again :D
neotoma
User
User
Posts: 84
Joined: Sun Dec 14, 2003 6:38 pm
Location: Germany, Mechernich
Contact:

Post by neotoma »

T-Light wrote: On the texture front, is there a reasonably fast way of copying the irrlicht texture to a free memory area, altering the data, then copying back? I might be able to get away with that.
At the Moment - not. If you think about change the Texture when running. Otherwise you can use a PB-Image (CreateImage/LoadImage/CatchImage) and add this as Texture.
Otherwise i will try after my holidays (starts tomorrow) to add functions for Texture-Manipulation. (You will get a pointer to the Data, height, width and depth.)

Mike
T-Light
User
User
Posts: 45
Joined: Sat Aug 05, 2006 5:42 pm
Location: UK

Post by T-Light »

WooHoo, Good Man 8)
T-Light
User
User
Posts: 45
Joined: Sat Aug 05, 2006 5:42 pm
Location: UK

Post by T-Light »

Thanks Mike,
IrrSetViewPort did the job :D , it took a while to figure out how to keep the resolution static throughout the window sizing but I'm there now (that'll teach me to code in the small hours of sunday morning :roll: ).

There might be a problem with IrrGetViewPort, it seems to cause 'Invalid Memory Access' errors. No worries though, It's not needed.

Thankyou very much (again), Enjoy your Hols :D
Post Reply