Equally, you can rotate "the object you are moving" 's UP vector until it points in the same direction as the terrains normal. Then do a cross product on the new UP vector and the right vector, which will give you the look vector.
- Viewing Profile: Reputation: dAND3h
Community Stats
- Group Members
- Active Posts 60
- Profile Views 1,429
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Contacts
dAND3h hasn't added any contacts yet.
#5013198 Move look vector along terrain up and downs
Posted by dAND3h
on 21 December 2012 - 12:20 PM
#5000634 Need Help making a good particle engine
Posted by dAND3h
on 13 November 2012 - 12:50 PM
Particle Engine---has many-->Particle Emitters---has many--->particles. You will want to create a method by which you send chunks of the number of particles to the graphics card at once, to save draw calls.
For the actual particles, you need to think about what attributes you would like for the emitter. Max particles speed, colour, and of course texture. etc.
If you want to make an efficient GPU based particle system, you will do world calculations inside the shader. This includes scaling,translation and rotations. For instance, you can create a simple particle trajectory with a start time and velocity.
position = (currentTime - startTime)*constantVelocity
Where startTime is passed into the vertex shader from the application.
You can also manage to pass just the centre position of the starting particle into the shader, and transform each vertex of the quad using that position and the UV coordinates.
As for tutorials, I have yet to see a satisfactory one. Most seem to fly past important topics without discussing them.
#4991510 The process of making a level editor
Posted by dAND3h
on 18 October 2012 - 12:45 PM
Because I had such a short amount of time, I decided to limit the artists abilities to just translate,scale and rotate objects. I also decided to leave out the ability to add textures in the editor. I believe as a starting point, this is what you should aim to do.
You would have to make a decision as to whether or not you want to load the models from within the program dynamically, or to load them before hand. Clearly the dynamic option would be more use to the artist, as they wouldn't need you to dig around the code to load another model, but as a start, the pre-load method is adequate.
For ray-casting, you need to make sure you are only casting inside the "viewport" where your scene is being rendered. Otherwise, you will end up with a bogus cast because of the mouse position taking the entire window into account.
#4947392 Particle Engine, Creating alot of Rain/Snow
Posted by dAND3h
on 08 June 2012 - 09:22 AM
Most modern particle systems use the GPU for both rendering and calculating positions. And then some sort of particle collision system on the CPU. Using the GPU , you will then batch alot of particles together, in a DynamicVertexBuffer which will be sent to the graphics card at once! Turning 10,000 draw calls into maybe 2 or 3!
You should post both the CreateNewParticle and RenderParticle methods.
#4928855 Help a noob pave his path into game development?
Posted by dAND3h
on 06 April 2012 - 12:38 PM
With my ultimate goal of being able to implement my
owngame ideas"
Why does that stop you from using C++?
#4928640 Beginning programmer needing some advice
Posted by dAND3h
on 05 April 2012 - 06:57 PM
All seriousness though, Apparently, XNA is on the chopping block to be discontinued, as of Windows 8 there will be no more support for it.
Unity3D(lite) is all the rage at the moment for indie developers anyway, kind of depends on what you want to do. Unreal is always an awesome engine.
Wow, I doubt I could be more unhelpful to your original question if I tried, sorry!
#4928638 models hiding other models
Posted by dAND3h
on 05 April 2012 - 06:46 PM
Set
GraphicsDevice.DepthStencilState = DepthStencilState.Default; at the start of your draw method.
#4928637 render 3D primitive
Posted by dAND3h
on 05 April 2012 - 06:43 PM
So, inside the draw method, set :
GraphicsDevice.DepthStencilState = DepthStencilState.Default;
And if your not already, you should draw any 2d sprites AFTER you draw your 3d models/primitives. So put the spriteBatch.Draw() after the call to base.Draw() in your draw method.
#4928635 Rotate model towards given coordinate
Posted by dAND3h
on 05 April 2012 - 06:30 PM
So, you have a Vector3 Position of the object you want to face.
desiredDirection = ObjectPosition - planePositon ; //Ok, so you have the direction you want to face, now we need to recalculate our other direction vectors Right = Vector3.Cross(Up,desiredDirection); //We need to normalize this Vector3.Normalize(ref Right, out Right); //then get the new forward/look Vector Forwards = Vector3.Cross(Up,Right); //normalize again Vector3.Normalize(ref Forwards,out Forwards); //then we need the new Up vector Vector3.Cross(Right,Forwards); //Now comes the fun part. We need an homogenous Matrix to represent this transformation around 3 different axis simultaneously. So it will be a 4d //matrix like so: Matrix rot = new Matrix(Right.X,Right.Y,Right.Z,0, Up.X, Up.Y, Up.Z, 0, Forwards.X, Forwards.Y, Forwards.Z, 0, 0, 0, 0, 1); //As you can see, the last dimension has no translation. //If you then just multiply your world matrix with the matrix you created here, your plane should turn to face your object.
#4798512 Collision Mask SDL
Posted by dAND3h
on 14 April 2011 - 01:03 PM
1. I create my level using paint or whatever.
2. Then what I do is create a new layer, and draw for example, a straight black rectangle over the ground. I then delete the original level layer so I am just left with the black rectangle.
3. Load the map and mask into separate SDL_Surfaces.
But after this is where I do not understand what to do! I have some questions that I would be grateful for an answers:
1. How do I actually test the collision?
2. Do I have to iterate through each pixel in the mask and then check the colour of the pixel?
3. How do I set a different type of collision on a different colour?(I'm guessing I just do some check like: if(pixel is black) COLLISION_TYPE = ground)...but that seems wrong?
4. Do I have to iterate through the entire mask every time through my game loop? Which would mean iterating through each pixel?
5. How would I apply a mask to a moving surface, such as my player character?
I am sorry for being so noob but this is really hard to understand. Please can somebody try to answer these questions. Thanks
- Home
- » Viewing Profile: Reputation: dAND3h

Find content