Author Topic: B3D Mesh IrrlichtWrapper  (Read 3841 times)

0 Members and 1 Guest are viewing this topic.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
B3D Mesh IrrlichtWrapper
« on: January 14, 2009 »
Code: [Select]
#include "IrrlichtWrapper.bi"

' irrlicht objects
Dim B3DMesh As irr_mesh
Dim MeshTexture As irr_texture
Dim SceneNode As irr_node
Dim OurCamera As irr_camera


' start the irrlicht interface
IrrStart( IRR_EDT_OPENGL, 400, 200, IRR_BITS_PER_PIXEL_32, _
        IRR_WINDOWED, IRR_SHADOWS, IRR_IGNORE_EVENTS )

' load a mesh this acts as a blue print for the model
B3DMesh = IrrGetMesh( "mymesh.b3d" )

' load texture resources for texturing the scene nodes
MeshTexture = IrrGetTexture( "mytexture.jpg" )

' add the mesh to the scene as a new node
SceneNode = IrrAddMeshToScene( B3DMesh )

' apply a material to the node to give its surface color
IrrSetNodeMaterialTexture( SceneNode, MeshTexture, 0 )

' switch off lighting effects on this model
IrrSetNodeMaterialFlag( SceneNode, IRR_EMF_LIGHTING, IRR_OFF )

' add a camera into the scene,
OurCamera = IrrAddCamera( 10,0,-10, 0,0,0 )


' -----------------------------------------------------------------------------
' while the irrlicht environment is still running
While IrrRunning
    ' begin the scene, erasing the canvas with sky-blue before rendering
    IrrBeginScene( 240, 255, 255 )

    ' draw the scene
    IrrDrawScene
   
    ' draw the GUI
    IrrDrawGUI

    ' end drawing the scene and render it
    IrrEndScene
Wend

' -----------------------------------------------------------------------------
' Stop the irrlicht engine and release resources
IrrStop
 

I try put Texture on but the texture doesnt show on the screen.

FREEBASIC VERSION
===============


3D world Studio
============


I want Freebasic Version to match the 3D WORLD Studio Screenshot and I am wondering why the texture isnt working when it is.






Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: B3D Mesh IrrlichtWrapper
« Reply #1 on: January 14, 2009 »
from my very little knowledge in FB i noticed this.

you are trying to load clumpy_grass.jpeg but in the compiler you refer to the jpeg as

Code: [Select]
' load texture resources for texturing the scene nodes
MeshTexture = IrrGetTexture( "mytexture.jpg" )

i think you need to replace the above part with ->

Code: [Select]
' load texture resources for texturing the scene nodes
MeshTexture = IrrGetTexture( "clumpy_grass.jpeg" )


Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: B3D Mesh IrrlichtWrapper
« Reply #2 on: January 16, 2009 »
I have try that but it is the same outcome  :(

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: B3D Mesh IrrlichtWrapper
« Reply #3 on: January 19, 2009 »
Not familiar with B3D Mesh IrrlichtWrapper in Freebasic, and this is not a solution, more of a check list.

One thing you might want to try is, in making sure your camera positionings are correct. I often get confused with the z position, maybe you are too. Also check that the position of your mesh is correct.

And one other after thought, check where your media is located. Perhaps you have other folders they are in?
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: B3D Mesh IrrlichtWrapper
« Reply #4 on: January 20, 2009 »
Quote
Not familiar with B3D Mesh IrrlichtWrapper in Freebasic, and this is not a solution, more of a check list.

One thing you might want to try is, in making sure your camera positionings are correct. I often get confused with the z position, maybe you are too. Also check that the position of your mesh is correct.

And one other after thought, check where your media is located. Perhaps you have other folders they are in?

As for camera angle....I did change it abit but the texture is remind the same  :(
All Texture and 3D Models are in one folder along with the code. I do know the texture and 3D Models are Loaded.

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: B3D Mesh IrrlichtWrapper
« Reply #5 on: January 20, 2009 »
In the screenshot from "3d world studio" lighting is enabled, in your code it's disabled:
Code: [Select]
IrrSetNodeMaterialFlag( SceneNode, IRR_EMF_LIGHTING, IRR_OFF )So if your vertex-color is black you won't see any texture.
Challenge Trophies Won:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: B3D Mesh IrrlichtWrapper
« Reply #6 on: January 20, 2009 »
thank you very much  hellfire   :)