Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


MARS_999

Member Since 06 Mar 2001
Offline Last Active Today, 02:33 AM

#5160065 Help with the math on this?

Posted by MARS_999 on 12 June 2014 - 10:04 AM

thanks for all the help guys!!!




#5153496 SDL2 and mouse movement to move screen

Posted by MARS_999 on 14 May 2014 - 12:57 AM

Here is what I came up with... thanks for everyones help!!!

 

void NX::App::onLoop()
{
int x = 0, y = 0;
SDL_GetMouseState(&x, &y);
if(x > (SW - 100))
{
SDL_WarpMouseInWindow(MainWindow, SW, y);
moveX +=5;
}
if(x < 100)
{
SDL_WarpMouseInWindow(MainWindow, 0, y);
moveX -=5;
}
if(y > (SH - 100))
{
SDL_WarpMouseInWindow(MainWindow, x, SH);
moveY +=5;
}
if(y < 100)
{
SDL_WarpMouseInWindow(MainWindow, x, 0);
moveY -=5;
}
}



#5147048 tinyxml2 and how to read files

Posted by MARS_999 on 15 April 2014 - 12:26 AM

thanks guys I found this to work so far...

 

 
for(tinyxml2::XMLElement* child = doc.FirstChildElement("resources")->FirstChildElement("resource"); 
child != 0; child = child->NextSiblingElement())
{
if(child->ToElement()->Attribute("UID"))
std::cout << "UID = "        << child->ToElement()->Attribute("UID")        << std::endl;
if(child->ToElement()->Attribute("type"))
std::cout << "type = "      << child->ToElement()->Attribute("type")       << std::endl;
if(child->ToElement()->Attribute("filename"))
std::cout << "filename = "   << child->ToElement()->Attribute("filename")   << std::endl;
if(child->ToElement()->Attribute("scenescope"))
std::cout << "scenescope = " << child->ToElement()->Attribute("scenescope") << std::endl;
if(child->ToElement()->Attribute("audio_type"))
std::cout << "audio_type = " << child->ToElement()->Attribute("audio_type") << std::endl;
std::cout << std::endl;
} 



#5129028 FSM libs out there for games?

Posted by MARS_999 on 05 February 2014 - 09:07 AM

I don't need all the smart a** comments... thanks. Looking for help not joke's


#5128344 Bit mask math

Posted by MARS_999 on 03 February 2014 - 12:30 AM

if((id &= ~(NX::COLLISION_ID_IsPickable | NX::COLLISION_ID_IsHighlightable)) == 200)

 

sigh fat fingered my ()

 

now it works




#5122782 VTF with GLSL 1.2

Posted by MARS_999 on 10 January 2014 - 08:21 PM

Nevermind ugh been so dam long since I coded getting rusty... I was using the second texture unit and not selecting gl_MultiTexCoord1 vs. gl_MultiTexCoord0....

 

Updated code now it works!!!!

 
#version 120
uniform mat4 mWorldViewProj;
uniform mat4 mInvWorld;
uniform mat4 mTransWorld;
uniform vec3 mLightPos;
uniform vec4 mLightColor;
uniform sampler2D displacementMap;
 
void main()
{
vec4 dv = texture2DLod(displacementMap, vec2(gl_MultiTexCoord1), 0.0);
//float df = 0.30*dv.x + 0.59*dv.y + 0.11*dv.z;
//vec4 newVertexPos = vec4(gl_Normal * df * 2.0, 0.0) + gl_Vertex;
vec4 newVertexPos = gl_Vertex + vec4(0.0, dv.y, 0.0, 0.0);
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = mWorldViewProj * newVertexPos;
}



#5069034 Why is my screen centered 0,0 in the middle of screen?

Posted by MARS_999 on 11 June 2013 - 11:09 PM

One last quick question, how can I change the buildProjectionMatrixOrthoOffCenterRH() to be LH()?

 

Thanks!




#5069009 Why is my screen centered 0,0 in the middle of screen?

Posted by MARS_999 on 11 June 2013 - 07:01 PM

L. Spiro

 

THANK you! That did the trick!!! Odd that the developers at Irrlicht don't have the ability to choose this seems simple to add the parameter on calling the buildProjectionMatrixOrthoRH() to make it offset... :)




#5068995 Why is my screen centered 0,0 in the middle of screen?

Posted by MARS_999 on 11 June 2013 - 05:15 PM

I am using Irrlicht 1.8 and when I try and setup a orthogonal projection with buildProjectionMatrixOrthoRH(), if I position the object it's (0,0) origin is the middle of the screen... I would like to have the coordinates start with the top or bottom left as the 0,0 point.

 

If I call draw2DPolygon() the top left is (0,0) and if I call drawIndexedTriangleFan() or draw2DVertexPrimitiveList() the center of the screen is (0,0)

 

I am not sure why this is, but need to get this solved.

 

 

http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=48773

 

 




#5051692 How to sort a vector and push object down e.g. like a stack...

Posted by MARS_999 on 09 April 2013 - 07:37 PM

Bah I cheated....

 

for(unsigned int i = 0; i <p->GetScores().size(); ++i)
                {
                    if(player->GetScore() > p->GetScores()[i].score)
                    {
                        temp.name  = playerEditbox->getText();
                        temp.score = player->GetScore();
                        temp.level = player->GetLevel();
                        p->GetScores().push_back(temp);
                        break;
                    }
                }
                std::sort(p->GetScores().begin(), p->GetScores().end(), NX::GameData::SortGreater);
                p->GetScores().pop_back();  

 

still be curious to see how it should be done correctly! :)

 

Thanks!




#5027142 Bumpmapping 2D Texture images

Posted by MARS_999 on 30 January 2013 - 04:40 AM

http://archive.gamedev.net/archive/reference/articles/article327.html

 

I am trying to figure out, is this a method for making a texture of e.g. stone that is on a 2D game tileset look bumpmapped?

 

I would like to make my 2D game images look like they are normalmapped and was wondering is this approach better suited for 2D games vs. just using a RGB normalmap on a 2D texture that never moves?

 

THanks!




#5008276 Irrlicht any good?

Posted by MARS_999 on 07 December 2012 - 06:07 PM

Wow, so many people have such broad opinions on all these engines and design/coding practices.... :(

I am not interested in learning C# so no to that. I have not enough time to mess around with another aspect in my life anymore.

I am getting the gist that Orge3D or Panda3d maybe the way to go... What about C4?

Thanks!


#4986214 PBO and glBufferSubData

Posted by MARS_999 on 02 October 2012 - 04:24 PM

ARGH!!!

Forget it!!!

I fat fingered it.....

glGetBufferSubData() was the problem... sigh!!!!


#4984533 Math to calculate positions and keep them with in a texture size limit

Posted by MARS_999 on 27 September 2012 - 05:26 PM

You want something that maps points like (10, -102) into your texture. In that case, x=10, y=-102. What else could I possibly mean?


Well I was confused as you posted Point p and didn't use p.x or p.y so I was wondering where x,y was coming from... Sometimes people post stuff quick without proof reading. But yeah, my assumption would have been location (x,y) but wanted to clarify it.

BTW works great!!! Thanks!!!!


#4981124 Particles on the GPU

Posted by MARS_999 on 17 September 2012 - 09:42 PM


What GL version you targeting?


I'm targeting GL 2.1 as far as I know there should be an extension for geometry shaders


Nvidia will have support for it under 2.1 and IIRC AMD with DX10 class hardware, but you can forget about Intel.... unless it supports GL3+ explicitly.




PARTNERS