Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Ogre3d, objekti i materijali

[es] :: GameDev - Razvoj Igara :: Ogre3d, objekti i materijali

[ Pregleda: 2887 | Odgovora: 8 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

PavleBgd
Pavle Joksimovic
Beograd

Član broj: 25177
Poruke: 112
*.122.eunet.yu.



Profil

icon Ogre3d, objekti i materijali03.09.2006. u 17:48 - pre 214 meseci
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

[Ovu poruku je menjao PavleBgd dana 03.09.2006. u 20:13 GMT+1]

[Ovu poruku je menjao PavleBgd dana 09.09.2006. u 09:41 GMT+1]
Prikačeni fajlovi
 
Odgovor na temu

franticnick

Član broj: 19656
Poruke: 372
195.252.78.*

Sajt: www.franticnick.com


+30 Profil

icon Re: Ogre3d, objekti i materijali03.09.2006. u 23:28 - pre 214 meseci
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.
 
Odgovor na temu

PavleBgd
Pavle Joksimovic
Beograd

Član broj: 25177
Poruke: 112
*.68.eunet.yu.



Profil

icon Re: Ogre3d, objekti i materijali03.09.2006. u 23:56 - pre 214 meseci
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



[Ovu poruku je menjao PavleBgd dana 04.09.2006. u 01:06 GMT+1]
Prikačeni fajlovi
 
Odgovor na temu

PavleBgd
Pavle Joksimovic
Beograd

Član broj: 25177
Poruke: 112
*.68.eunet.yu.



Profil

icon Re: Ogre3d, objekti i materijali04.09.2006. u 00:03 - pre 214 meseci
Evo kako izgleda entitet u Max-u.
Prikačeni fajlovi
 
Odgovor na temu

franticnick

Član broj: 19656
Poruke: 372
195.252.78.*

Sajt: www.franticnick.com


+30 Profil

icon Re: Ogre3d, objekti i materijali04.09.2006. u 10:47 - pre 214 meseci
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.
 
Odgovor na temu

PavleBgd
Pavle Joksimovic
Beograd

Član broj: 25177
Poruke: 112
*.186.eunet.yu.



Profil

icon Re: Ogre3d, objekti i materijali04.09.2006. u 15:57 - pre 214 meseci
Probao sam i druge opcije u exporteru (ukljucujuci i Export material) malo pre. Pokusao sam i sa promenom materijala. .Max u prilogu
Pozdrav
Prikačeni fajlovi
 
Odgovor na temu

PavleBgd
Pavle Joksimovic
Beograd

Član broj: 25177
Poruke: 112
*.186.eunet.yu.



Profil

icon Re: Ogre3d, objekti i materijali04.09.2006. u 16:04 - pre 214 meseci
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
 
Odgovor na temu

PavleBgd
Pavle Joksimovic
Beograd

Član broj: 25177
Poruke: 112
*.137.eunet.yu.



Profil

icon Re: Ogre3d, objekti i materijali09.09.2006. u 02:00 - pre 214 meseci
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

 
Odgovor na temu

franticnick

Član broj: 19656
Poruke: 372
62.58.4.*

Sajt: www.franticnick.com


+30 Profil

icon Re: Ogre3d, objekti i materijali12.09.2006. u 17:43 - pre 214 meseci
E, dobro je.

Nisam bio u prilici da se vise pozabavim tvojim problemom jer sam trenutno u procesu preseljenja. U svakom slucaju, pitaj i ubuduce.

 
Odgovor na temu

[es] :: GameDev - Razvoj Igara :: Ogre3d, objekti i materijali

[ Pregleda: 2887 | Odgovora: 8 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.