Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 8 odgovora
  • 3.932 pregleda

Najnovija ↓

Ogre3d, objekti i materijali 03.09.2006. u 18:48 · pre 245 meseci
izmenjeno 2 puta, poslednji put PavleBgd 09.09.2006. u 09:41
  1. PavleBgd09.09.2006. u 09:41zapis iz teksta poruke
  2. PavleBgd03.09.2006. u 20:13zapis iz teksta poruke
#1
Posto imam jos pitanja u vezi Ogre-a sugerisano mi je da otvorim drugu temu(hvala franticnick na iscrpnom odgovoru).
U 3DSMax sam kreirao jednostavni objekat (kocku). Dodao sam mu materijal (BeachStones.jpg koji se nalazi u ..\media\materials\textures OgreSDK paketa). U Render prozoru kao i pomocu oFusion paketa se u Max-u objekat noramlno vidi (sa teksturom).
Objekat sam zatim eksportovao u XML pomocu OgreMaxExportera i konvertovao ga u mesh koristeci OGREXMLConverter ("kocka.mesh")

U CreateScene() metod aplikacije sam dodao sledeci kod:

Code:

         mSceneMgr->setAmbientLight( ColourValue( 1.0f, 1.0f, 1.0f ) );


         ent = mSceneMgr->createEntity( "Kocka", "kocka.mesh" );
         node = mSceneMgr->getRootSceneNode( )->createChildSceneNode( "KockaNode", Vector3(  0.0f, -10.0f,  25.0f ) );
         node->attachObject( ent );
         node->setScale( 0.2f, 0.2f, 0.2f );

         ent = mSceneMgr->createEntity( "Knot1", "knot.mesh" );
         node = mSceneMgr->getRootSceneNode( )->createChildSceneNode( "Knot1Node", Vector3(  0.0f, 0.0f,  100.0f ) );
         node->attachObject( ent );
         node->setScale( 0.1f, 0.1f, 0.1f );


U Materials script sam dodao opis materijala:
Code:

material KockaSkin
{
    technique
    {
        pass
        {

            texture_unit
            {
                texture BeachStones.jpg
            }
        }
    }
}


Evo ga isecak iz ogre.log-a (oznaceno sa >>>):
Code:

18:39:45: Parsing script Example-Water.overlay
18:39:45: Parsing script Shadows.overlay
18:39:45: Finished parsing scripts for resource group General
>>> 18:39:45: Mesh: Loading kocka.mesh.
>>> 18:39:45: Texture: BeachStones.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
18:39:45: Mesh: Loading knot.mesh.
18:39:45: D3D9 : ***** Dimensions altered by the render system
18:39:45: D3D9 : ***** Source image dimensions : 780x511
18:39:45: D3D9 : ***** Texture dimensions : 1024x512
18:39:45: Texture: MtlPlat2.jpg: Loading 1 faces(PF_B8G8R8,780x511x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x512x1.
18:39:46: Win32Input8: DirectInput Activation Starts


Kada pokrenem aplikaciju kocka se pojavi na pravom mestu. Medjutim kocka nema teksturu, vec je samo sive boje? Ono sto je interesantno je da pored ovoga je prikazan sasvim normalno drugi objekat (knot.mesh) sa teksturom.

Kako da mi se normalno prikaze tekstura na objektu (onako kako se to vidi uz pomoc oFusion-a u Maxu)?
Pozdrav
Re: Ogre3d, objekti i materijali 04.09.2006. u 00:28 · pre 245 meseci #2
Posalji mi .xml, .mesh i .material fajlove koje si generisao. Sigurno je neka glupost.


Da li si .material fajl snimio u ..\media\materials\scripts? Moguce je da je i do konvertora jer ih ima u vise verzija, videcemo kada posaljes fajlove.
Re: Ogre3d, objekti i materijali 04.09.2006. u 00:56 · pre 245 meseci
izmenjeno 1 put, poslednji put PavleBgd 04.09.2006. u 01:06
  1. PavleBgd04.09.2006. u 01:06zapis iz teksta poruke
#3
Citat:

Da li si .material fajl snimio u ..\media\materials\scripts?


Da snimio sam ga na to mesto. Cak me je Ogre bio i upozorio kada nije uspeo da ga nadje (tada sam ga premestio u scripts).
Svi fajlovi su u prilogu uz poruku.
Pozdrav
Re: Ogre3d, objekti i materijali 04.09.2006. u 11:47 · pre 245 meseci #5
Kao da nisi exportovao kako treba. Nemam sad instaliran MAX i oFusion da bih probao, ali vidi da li ima nekih opcija u koje nisi "stiklirao" prilikom eksportovanja.

Posalji mi i .max fajl.
Re: Ogre3d, objekti i materijali 04.09.2006. u 16:57 · pre 245 meseci #6
Probao sam i druge opcije u exporteru (ukljucujuci i Export material) malo pre. Pokusao sam i sa promenom materijala. .Max u prilogu
Pozdrav
Re: Ogre3d, objekti i materijali 04.09.2006. u 17:04 · pre 245 meseci #7
Ovo je izlaz XMLConvertera

Code:

-- OPTIONS --
source file      = kocka.mesh.xml
destination file = kocka.mesh
log file         = OgreXMLConverter.log
interactive mode = false
lod levels       = none (or use existing)
Generate edge lists  = 1
Generate tangents = 0
Reorganise vertex buffers = 1
Optimise animations = 1
-- END OPTIONS --

Creating resource group General
Creating resource group Internal
Creating resource group Autodetect
Registering ResourceManager for type Mesh
Registering ResourceManager for type Material
Registering ResourceManager for type Skeleton
XMLMeshSerializer reading mesh data from kocka.mesh.xml...
Reading submeshes...
Reading geometry...
Geometry done...
Reading geometry...
Geometry done...
Reading geometry...
Geometry done...
Reading geometry...
Geometry done...
Reading geometry...
Geometry done...
Reading geometry...
Geometry done...
Submeshes done.
XMLMeshSerializer import successful.
Reorganising vertex buffers to automatic layout..
Generating edge lists....
MeshSerializer writing mesh data to kocka.mesh...
File header written.
Writing mesh data...
Writing submesh...
Exporting submesh texture aliases...
Submesh texture aliases exported.
Submesh exported.
Writing submesh...
Exporting submesh texture aliases...
Submesh texture aliases exported.
Submesh exported.
Writing submesh...
Exporting submesh texture aliases...
Submesh texture aliases exported.
Submesh exported.
Writing submesh...
Exporting submesh texture aliases...
Submesh texture aliases exported.
Submesh exported.
Writing submesh...
Exporting submesh texture aliases...
Submesh texture aliases exported.
Submesh exported.
Writing submesh...
Exporting submesh texture aliases...
Submesh texture aliases exported.
Submesh exported.
Exporting bounds information....
Bounds information exported.
Exporting submesh name table...
Submesh name table exported.
Exporting edge lists...
Edge lists exported
Mesh data exported.
MeshSerializer export successful.
Unregistering ResourceManager for type Skeleton
Unregistering ResourceManager for type Material
Unregistering ResourceManager for type Mesh
Re: Ogre3d, objekti i materijali 09.09.2006. u 03:00 · pre 245 meseci #8
Da javim da sam uspeo da resim problem. Sve je u redu i sa Ogreom i sa 3DMax-om ali da bi XML exporter pravilno eksportovao podatke o meshu (ukljucujuci i koordinate teksture na entitetu) potrebno je izvrsiti mapiranje direktno u 3DMax-u(Modifiers->UV Coordinates->UVW Map).

Stari XML
Code:

<vertex> 
   <position x="-49.4253" y="0.0" z="44.4444" /> 
   <normal x="0.0" y="-1.0" z="0.0" /> 
</vertex> 



Novi XML

Code:

<vertex> 
   <position x="-49.4253" y="0.0" z="44.4444" /> 
   <normal x="0.0" y="-1.0" z="0.0" /> 
   <texcoord u="0.999501" v="0.9995" /> 
</vertex> 


Kao sto se moze videti u novom XML eksportu je i textcoord item :)
Pozdrav

Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme