Search found 60 matches

by radubolovan
Tue Jan 15, 2008 10:30 pm
Forum: Beginners Help
Topic: SMaterial problem
Replies: 12
Views: 637

You did not set Normal ...this may be ok if you disabled lighting but if lighting is on you might get weird results. I'm working on it! :) I'm trying to make a sun ... I've calculated positions and it's work just fine ... now the normals should be the vector: (sunpos - cam_pos).normalized(); I thin...
by radubolovan
Mon Jan 14, 2008 11:16 pm
Forum: Beginners Help
Topic: SMaterial problem
Replies: 12
Views: 637

Now I know :)
Anyway ... if you read my first post you will se that I setted most things ... the only problem was this:

Code: Select all

m_tex[0].Color = m_tex[1].Color = m_tex[2].Color = m_tex[3].Color = SColor( 255, 255, 255, 255 );
Thank you again!
by radubolovan
Mon Jan 14, 2008 7:41 pm
Forum: Beginners Help
Topic: SMaterial problem
Replies: 12
Views: 637

new code: m_tex[0].Pos = vector3df( m_pos.X-0.5f, m_pos.Y+0.5f, m_pos.Z ); m_tex[1].Pos = vector3df( m_pos.X-0.5f, m_pos.Y-0.5f, m_pos.Z ); m_tex[2].Pos = vector3df( m_pos.X+0.5f, m_pos.Y-0.5f, m_pos.Z ); m_tex[3].Pos = vector3df( m_pos.X+0.5f, m_pos.Y+0.5f, m_pos.Z ); m_tex[0].TCoords = vector2df( ...
by radubolovan
Mon Jan 14, 2008 6:53 pm
Forum: Beginners Help
Topic: SMaterial problem
Replies: 12
Views: 637

1) texture is not NULL: 2) Loaded texture: home/radu/Proiecte/3D_data/Example1/textures/sun/sun.png 3) Vertex data is calculated dinamically ... the uv coords ... hm ... which parameter contains these? 4) are the code snippets exactly the same as you use in your prog ??? then there is an error with ...
by radubolovan
Sun Jan 13, 2008 10:16 pm
Forum: Beginners Help
Topic: SMaterial problem
Replies: 12
Views: 637

SMaterial problem

here is the code: SMaterial material; material.Lighting = false; material.ZBuffer = true; material.ZWriteEnable = true; material.BackfaceCulling = false; material.TextureLayer[0].TextureWrap = video::ETC_CLAMP; material.setTexture( 0, texture ); here is the draw: videoDriver->setMaterial( m_material...
by radubolovan
Fri Jan 11, 2008 6:31 pm
Forum: Beginners Help
Topic: problem scalling a 3DS mesh object
Replies: 2
Views: 243

Yupiiiiiiiiiiiiiiiii! I did it! :) Here is the code: char szFile[1024]; sprintf( szFile, "%s%s", workingDir(), "objetcs/latura_podea.3ds" ); scene::IAnimatedMesh* m1 = sceneManager->getMesh( szFile ); IMeshManipulator* meshMan = sceneManager->getMeshManipulator(); int nIndex; for...
by radubolovan
Wed Jan 09, 2008 10:27 pm
Forum: Beginners Help
Topic: Textures problem - low res
Replies: 2
Views: 154

Fixed the screen depth set to 32 bits and it's working! :) Thank you!
by radubolovan
Wed Jan 09, 2008 9:42 pm
Forum: Beginners Help
Topic: Textures problem - low res
Replies: 2
Views: 154

Textures problem - low res

I have a problem with textures ... here is my code: driver->setTextureCreationFlag( video::ETCF_CREATE_MIP_MAPS, false ); smgr->addSkyBoxSceneNode( driver->getTexture( m_szSkyBox[0] ), driver->getTexture( m_szSkyBox[1] ), driver->getTexture( m_szSkyBox[2] ), driver->getTexture( m_szSkyBox[3] ), driv...
by radubolovan
Sat Dec 15, 2007 1:17 pm
Forum: Beginners Help
Topic: problem scalling a 3DS mesh object
Replies: 2
Views: 243

problem scalling a 3DS mesh object

Hello I'm trying to scale a mesh and nothing happens. Here is the code: sprintf( szFile, "%s%s", instance()->dir(), "objetcs/cub_4_laturi.3ds" ); scene::IAnimatedMesh* m = instance()->irrSceneManager()->getMesh( szFile ); IMeshManipulator* meshMan = instance()->irrSceneManager()-...
by radubolovan
Thu Nov 22, 2007 9:00 pm
Forum: Beginners Help
Topic: How to save and load a game?
Replies: 15
Views: 1173

Another posibility is to create a ByteArray class and implement methods like WriteByte, WriteInt, WriteFloat, WriteString, etc and ReadByte, ReadInt, ReadFloat, ReadString. And then a SaveManager class who has a ByteArray prroperty and saves/loads to/from a file anything you want. It's tricky, but a...
by radubolovan
Thu Nov 15, 2007 10:02 am
Forum: Bug reports
Topic: [not a bug] bug in COpenGLDriver::draw2DImage( ... )
Replies: 3
Views: 569

I see! And what should I do if I want to draw an image in a rectangle for example: 1) tex is 50x50 pixels 2) rectangle is 100x100 pixels 3) I want the texture to be drawn having 100x100 pixels. I've tried that with that function and I saw nothing but my texture drawn having 50x50 pixels and the rest...
by radubolovan
Wed Nov 14, 2007 11:20 pm
Forum: Bug reports
Topic: [not a bug] bug in COpenGLDriver::draw2DImage( ... )
Replies: 3
Views: 569

[not a bug] bug in COpenGLDriver::draw2DImage( ... )

I saw the code in function: void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect, SColor color, bool useAlphaChannelOfTexture) And there are some lines of code: glTexCoord2f(tcoord...
by radubolovan
Wed Nov 14, 2007 9:23 pm
Forum: Beginners Help
Topic: Drawing a image in 3D space
Replies: 4
Views: 319

Now I have another "problem". How can I draw that texture in 3D space (not 2D, using IVideoDriver->draw2DImage( ... );
I want to draw it in an 3d quadrilateral.

//later
And of course scale, rotate.
by radubolovan
Tue Nov 13, 2007 11:51 pm
Forum: Beginners Help
Topic: Drawing a image in 3D space
Replies: 4
Views: 319

Thank you very much! :) I new about IImage* IVideoDevice::createImageFromData(ECOLOR_FORMAT format, const core::dimension2d<s32>& size, void *data,...); And I thaught that ITexture * IVideoDevice::addTexture(const c8* name, IImage* image); will load a texture from a file ... I should look at the...
by radubolovan
Tue Nov 13, 2007 8:01 pm
Forum: Beginners Help
Topic: Drawing a image in 3D space
Replies: 4
Views: 319

Drawing a image in 3D space

I have an image in memory, I mean I know width, height, type (eg. ECF_A8R8G8B8) and a pointer to bytes data. How can I create a ITexture on the fly? (without write a png file to the disk and then driver->getTexture( "my_file" ) - I cand do that but it's not quite a cool option). Thank you!