Blokworld
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Various SlimDX - DirectX programming questions

2 posters

Go down

Various SlimDX - DirectX programming questions Empty Various SlimDX - DirectX programming questions

Post by S33m3 Sun May 01, 2011 12:35 am

I open a post to groupd all question regarding game programming with DirectX/SLimDX.

Can you tell me wich timer your are using ? (To compute time pass between 2 frames and doing related interpolation for movement) ?

Tx !

S33m3

Posts : 54
Join date : 2011-03-23

Back to top Go down

Various SlimDX - DirectX programming questions Empty Re: Various SlimDX - DirectX programming questions

Post by Slaihne Sun May 01, 2011 3:22 am

I use a Dotnet Stopwatch and use this to get the milliseconds...

(1000.0 * sw.ElapsedTicks) / Stopwatch.Frequency
Slaihne
Slaihne

Posts : 264
Join date : 2011-03-17
Age : 56

Back to top Go down

Various SlimDX - DirectX programming questions Empty Re: Various SlimDX - DirectX programming questions

Post by S33m3 Mon May 02, 2011 12:14 am

Same as me ... Still searching where my accuracy problem are coming from...

Another question Smile

How do you "fight" against Float precision problem ?
Camera world coordinate in double then transformed to float before computing view matrix ?

In my system I use the camera position as the center of the "world", and all the others objects are offset based on the camera world position.

S33m3

Posts : 54
Join date : 2011-03-23

Back to top Go down

Various SlimDX - DirectX programming questions Empty Re: Various SlimDX - DirectX programming questions

Post by Slaihne Mon May 02, 2011 3:01 am

I handle all the 'chunks' vertices as relative to the chunk. So, vertex co-ords range from 0..16 in x and z and from 0..128 in y.

Then i pass into my draw call a value i call the CamChunkOffset. This is the camera position, adjusted by the world co-ords for the chunk. I then adjust the vertex positions, within the draw, by this value. It sort of puts the vertex at it's world co-ords and then moves it relative to the camera in a single operation.

Then i do the whole view projection thing to transform the camera relative vertex.

It works but i still need to do some more testing to see if it works for larger values.
Slaihne
Slaihne

Posts : 264
Join date : 2011-03-17
Age : 56

Back to top Go down

Various SlimDX - DirectX programming questions Empty Re: Various SlimDX - DirectX programming questions

Post by S33m3 Mon May 02, 2011 3:43 am

It's funny that in the end we are doing the same things ... Smile

So it means that your View matrix location component is always (0,0,0). (In fact the view matrix location is incorporated inside the Object world matrix).

Like me at every frame (or everytime the camera is moving) you have to recompute for every world object it's "CamChunkOffset" on the "CPU".

At first it was strange to me, but what we are doing : "Instead of moving my camera, I will move all objects surrending my camera". This way the objects are placed in the world based on theirs position to the camera.

Do you store your camera world position into Float or double value ?

S33m3

Posts : 54
Join date : 2011-03-23

Back to top Go down

Various SlimDX - DirectX programming questions Empty Re: Various SlimDX - DirectX programming questions

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum