prabh's Profile User Rating: -----

Reputation: 3 Apprentice
Group:
Contributors
Active Posts:
379 (0.24 per day)
Joined:
27-December 08
Profile Views:
8,586
Last Active:
User is offline Apr 09 2013 12:53 AM
Currently:
Offline

Previous Fields

Country:
IN
OS Preference:
Windows
Favorite Browser:
Mozilla
Favorite Processor:
AMD
Favorite Gaming Platform:
PC
Your Car:
Toyota
Dream Kudos:
25

Latest Visitors

Icon   prabh Oh yeah..........

Posts I've Made

  1. In Topic: I want some information about writing data into binary files in C++

    Posted 2 Oct 2012

    I posted a snippet on Dreamincode.net you can check that if it works.
    My snippet
  2. In Topic: First attempt using header files, dosent work :/

    Posted 2 Oct 2012

    Look for comments i put.
    Your main.cpp should look something like this
    #include <iostream>
    #include "header.h"
    using namespace std;
    
    int main()
    {
    // the correct way
        int x= 0;
        int y= 0;
        int z = 0;
        cout << "Hello world!" << endl;
        while(1){
    // to update your x,y and z you should call your function
            example(x,x,z);
    	        cout<<"X: "<<x<<endl<<"Y: "<<y<<endl<<"Z: "<<z<<endl; //The x,y,z decleared in header.h
    	    }
        return 0;
    }
    
    

    header.h
    #ifndef HEADER_H_INCLUDED
    #define HEADER_H_INCLUDED
    #include <windows.h>
    
    int example( int x,int y,int z){
    
        if(GetAsyncKeyState(VK_UP)){y++;}
        if(GetAsyncKeyState(VK_DOWN)){y--;}
        if(GetAsyncKeyState(VK_RIGHT)){x++;}
        if(GetAsyncKeyState(VK_LEFT)){x++;}
        if(GetAsyncKeyState(VK_TAB)){z=1;}
        if(GetAsyncKeyState(VK_SPACE)){z=2;}
        if(GetAsyncKeyState(VK_SHIFT)){z=3;}
    
        return(0);
    }
    
    #endif // HEADER_H_INCLUDED
    
    
    
    

    This code compiled, but thats a horrible way to use while loop.
    You need to learn a lot buddy.
  3. In Topic: diffuse lighting error(Managed DirectX)

    Posted 6 Feb 2012

    float4 AmbientColor : Ambient
    <
    	string UIName =  "Ambient Color";
    >  = {0.8f, 0.8f, 0.8f, 1.0f};
    
    float4 DiffuseColor : Diffuse
    <
    	string UIName =  "Diffuse Color";
    >  = {0.8f, 0.8f, 0.8f, 1.0f};
    
    //float4 SpecularColor : Specular
    //<
    //	string UIName =  "Specular Color";
    //> = {0.8f, 0.8f, 0.8f, 1.0f};
    float4 light1Pos : POSITION
    <
    	string UIName = "Light Position";
    	string Object = "PointLight";
    	string Space = "World";
    	int refID = 0;
    > = {0.0f, -1.0f, -1.0f, 0.0f};
    
    float4 light1Color : LIGHTCOLOR
    <
    	int LightRef = 0;
    > = { 1.0f, 1.0f, 1.0f, 0.0f };
    
    //texture Diffuse :DiffuseMap <
    //string ResourceName = "";//Optional default file name
    //string UIName =  "Diffuse Texture";
    //string ResourceType = "2D";
    //>;
    
    //texture NormalMap :NormalMap <
    //string ResourceName = "";//Optional default file name
    //string UIName =  "Normal Texture";
    //string ResourceType = "2D";
    //>;
    /*
    texture SpecularMap :SpecularMap <
    string ResourceName = "";//Optional default file name
    string UIName =  "Specular Texture";
    string ResourceType = "2D";
    >;
    
    sampler2D DiffuseSampler = sampler_state {
    Texture = <Diffuse>;
    	MinFilter = Linear;
    	MagFilter = Linear;
    	MipFilter = Anisotropic;
    };
    
    sampler2D NormalMapSampler = sampler_state {
    Texture = <NormalMap>;
    	MinFilter = Linear;
    	MagFilter = Linear;
    	MipFilter = Anisotropic;
    };
    
    sampler2D SpecularMapSampler = sampler_state {
    Texture = <SpecularMap>;
    	MinFilter = Linear;
    	MagFilter = Linear;
    	MipFilter = Anisotropic;
    };
    */
    float Glosiness	  <
    string UIWidget = "slider";
    float UIMin = 0.0;
    float UIMax = 512.0;
    float UIStep = 1;
    string UIName =  "Glosiness";
    > = 0.5;
    	
    float4x4 WorldViewProj : WorldViewProjection;
    //float4x4 viewInverse:ViewInverse;
    float4x4 World         : World;
    float4x4 WorldInverseTranspose : WorldInverseTranspose;
    struct VSIN
    {
    	float4 Pos    :Position;
    	float2 tex    :TEXCOORD0;
    	float3 normal :Normal;
    	//float3 binormal:BINORMAL;
    	//float3 tangent :TANGENT;
    };
    struct VSOUT
    {
    	float4 Pos    :Position;
    	float2 tex    :TEXCOORD0;
    	float3 normal :TEXCOORD1;/*
    	float3 binormal:TEXCOORD2;
    	float3 tangent :TEXCOORD3;*/
    	float3 lightVec:TEXCOORD4;
    	//float3 eyeVec:TEXCOORD5;
    };
    VSOUT VS(VSIN In) {
    	VSOUT Out;
    	Out.Pos=mul(In.Pos,WorldViewProj);
    	Out.tex=In.tex;
    	Out.normal=mul(In.normal,WorldViewProj).xyz;
    	/*
    	Out.binormal=mul(In.binormal,WorldInverseTranspose).xyz;
    	Out.tangent=mul(In.tangent,WorldInverseTranspose).xyz;*/
    	float3 worldSpacePos = mul(In.Pos, World);						//put the vertex in world space
        Out.lightVec = light1Pos - worldSpacePos;	
    	//Out.eyeVec=viewInverse[3]-worldSpacePos;
    	return Out;
    	
    }
    
    float4 mainPS(VSOUT In) : COLOR {
    	
    	
    	//float4 ColorTexture=tex2D(DiffuseSampler,In.tex.xy);
    	//float3 normal=tex2D(NormalMapSampler,In.tex)*2.0-1;
    	//float4 SpecularTexture=tex2D(SpecularMapSampler,In.tex);
    	
    	float4 Ambient=AmbientColor;
    	
    	//float3 N=(normal.z*In.normal)+(normal.x*In.binormal)+(normal.y*In.tangent);
    	float3 N=In.normal;
    	N=normalize(N);
    	float3 L=normalize(In.lightVec.xyz);
    	//float3 V=normalize(In.eyeVec);
    	float4 D=saturate(dot(N,L))*light1Color;
    	float4 Diffuse=DiffuseColor*D;
    	
    	
    	//float3 H=normalize(L+V);
    	//float NdotH=saturate(dot(N,H));
    	//float gloss=Glosiness*SpecularTexture.a;
    	//float SpecPower=pow(NdotH,gloss);
    	//float4 Specular=SpecPower*SpecularColor*SpecularTexture;
    	
    	return Diffuse+Ambient;//+Specular;
    }
    
    technique technique0 {
    	pass p0 {
    		
    		VertexShader = compile vs_3_0 VS();
    		ZEnable = true;																//this enables sorting based on the Z buffer
    	ZWriteEnable = true;														//this writes the depth value to the Z buffer so other objects will sort correctly this this one
    	CullMode = CW;																//this enables backface culling.  CW stands for clockwise.  You can change it to CCW, or none if you want.
    	AlphaBlendEnable = false;	
    		PixelShader = compile ps_3_0 mainPS();
    	}
    }
    
    
  4. In Topic: Shifting to another OS.

    Posted 9 Sep 2011

    So it would be stupidity.
  5. In Topic: Shifting to another OS.

    Posted 9 Sep 2011

    you mean to say that no software or game will work that i download for windows

My Information

Member Title:
D.I.C Regular
Age:
21 years old
Birthday:
April 23, 1992
Gender:
Location:
New Delhi/India
Interests:
<<<<<<<<<<<<<<<<,,,,Gaming, Hacking,Game Hacking,Programming,electronics,computer hardware
eating,i dont sleep(i sleep on week ends),Music,
Movies(action+science fiction),,
and at last on T.V
1.History channel
Man moment and machine ,aushwitz ,tudors,boyz toyz
Dogfights
2.Discovery channel every thing>>>>>>>>>>>>>>>Fuck these things now i don't have time for them

time learn the basics of direct3d
Full Name:
Prabh Jot
Years Programming:
4
Programming Languages:
C/C++
VB.NET
C#.net
LilleBit of VC++ and Java
php
html

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://
ICQ:
ICQ  3

Comments

Page 1 of 1
  1. Photo

    sri Harsha Icon

    22 Apr 2010 - 06:57
    how to give tutorials ...
Page 1 of 1