Jump to content

  • Log In with Google      Sign In   
  • Create Account

plainoldcj

Member Since 18 Apr 2013
Offline Last Active Yesterday, 08:05 AM

Posts I've Made

In Topic: Keep 3D Game Object 'Stationary' On Screen

11 January 2015 - 09:46 AM

It sounds like the weapon is rotated around it's center and then translated, so maybe the order of

transformations is a problem and you can try to change translate * rotate to rotate * translate.

 

In general, you want the weapon to have a fixed position in camera space.

Therefore the easiest way is to not transform the weapon at all.

 

If you transform all your objects by the same "world" matrix, however, you want to give the weapon

a local transformation that cancels this effect. that is the weapon matrix is the inverse of the world matrix.

Try using a standard Invert() method first and see if it gives the desired results.

 

After that you can try to replace the Invert() call with a product of translation and rotation matrices.


In Topic: OIT (Order Independent Transparency)

17 September 2014 - 01:19 PM

Maybe it's already sufficient for your application to sort the individual triangles back-to-front.

You can store the vertices statically on the gpu and issue a sorted list of indices in every frame,

for example. It's not too bad.

 

If you really need perfect transparency you may consider depth peeling.

It's a multipass technique and runs on older hardware.

 

The cheapest trick is to draw in any order and tell everyone it's correct.

Most people don't notice alpha-blending errors anyways :)


In Topic: Panning camera so object is at edge of screen

16 September 2014 - 04:29 PM

Think in terms of frustrum planes, not view rays.

You could try something like this, again using the right frustrum plane for example:

1. get the plane equation

2. cast ray R along x-axis to find object-plane distance

3. move camera along x-axis so that distance is 0

depending on the object or which bounding geometry you use you should

sample the distance at every vertex and use the minimum or something like that.

im not really sure what you are trying to do. after the camera translation the object

should still be outside the camera view, right?


In Topic: Panning camera so object is at edge of screen

16 September 2014 - 12:44 PM

In the example above the right plane of the viewing frustrum should be a supporting plane of the object.

that is the object and the plane must intersect and the object must lie on one side of the plane.


In Topic: Problemas with glTranslated

16 September 2014 - 12:37 PM

Does your problem look similar to this: https://dl.dropboxusercontent.com/u/56764397/screendump0.png ?

When you talk about the camera losing pixels and objects moving into the screen this could be a clipping problem.


PARTNERS