Thanks.
- Viewing Profile: Posts: BornToCode
Community Stats
- Group Members
- Active Posts 611
- Profile Views 2,935
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
Posts I've Made
In Topic: OpenGL Auxiliary
Yesterday, 11:22 PM
In Topic: can direct3d9 be quickly converted to direct3d10
16 June 2013 - 04:17 PM
The entire API was redesigned. You pretty much have to rewrite everything. If you are considering using D3D10 you are better off moving to D3D11 since it introduce the FeatureLevel system which allows you to support Direct3D9.
In Topic: heightmaps and vbo's
16 June 2013 - 10:55 AM
It all depends on what you are trying to achieve, But usually the best way to start is to have one VBO and multiple IBO that reference different part of the terrain, that way you can have multiple textures use on the same terrain and render all batch that uses the same texture. The other option is to have one IBO and one VBO and just use an Atlas, but i would not recomemend doing that for terrain as it becomes an hasstle when you trying to blend between tiles on the terrain. There are tons of way you can go about this and what i just mention is only scratching the surface.
In Topic: can 'SetTextureStageState' be used with pixel shader
16 June 2013 - 10:51 AM
Like belfegor mention. In DirectX9 some of the render state still works while others no longer do anything once you use shaders.
In Topic: 3D Perspective Projection Issues
16 June 2013 - 10:37 AM
a,b,c represent the plane normal and x y z is the point you want to project.
if you you know A,B,C then computing d is -(p.x*pl.a+p.y*pl.b+p.z*pl.c) which is basically the -Dot(Normal,Point) where normal is represented by a,b,c and point is x,y,z.
The whole point of projecting is to figure out how far a surface is aways from something and that is what the DotDistance gives you, it tells you how far that point is from the plane. Once you know how far it is you can easily find the point on the plane by subtracting the plane dot distance from the point using the parametric equation of the line.
To find an point on a line you can use the parameteric equation of a line which is p=p0+D*t where p0 is your starting location, D is your direction and needs to be normalized and t is the distance. After you find the distance from the plane dot distance, you can go and plug it in the line parameteric equation and that will give you an point on the plane. I have written some code bellow that will help you achieved that.
Vector3 Vector3::Project(const Spartan::Vector3 &point, const Spartan::Plane &plane)
{
float distance = Plane::GetDistanceToPoint(plane,point);
return point-plane.normal*distance;
}
//**************************************************
//Get the distance to an point.
//**************************************************
float Plane::GetDistanceToPoint(const Spartan::Plane &plane,const Spartan::Vector3 &point)
{
return Vector3::Dot(plane.normal,point)+plane.distance;
}
- Home
- » Viewing Profile: Posts: BornToCode

Find content