Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Waterlimon

Member Since 28 May 2011
Offline Last Active Yesterday, 09:42 PM

Posts I've Made

In Topic: buoyant force total madness

Yesterday, 07:54 PM

Well there should be an equilibrium as long as the ship wont sink. Are you correctly calculating the boyancy force based on how much of the ships volume is below sea level?


In Topic: Portal view

Yesterday, 09:32 AM

To render the scene from the other portals viewpoint, the camera position/rotation must be same relative to the other portal as it was to the first portal.

 

Of course the other portal will be facing out of the wall, while the first portal will be facing into the wall.

 

So if you camera is 5 meters in front of the first portal, it needs to be 5 meters inside the wall when rendering the scene from the other portals point of view.

 

 

This 'relative position/rotation' would normally be encoded in a 4x4 affine matrix and you would use matrix math to calculate the correct location for the camera.

The logic would be something akin to (portal1 and portal2 are matrices that hold the pos/rot of the portals):

Matrix relative = portal1:toObjectSpace(camera)
Matrix renderFrom = portal2:toWorldSpace(relative) //if portal2 faces out of the wall and portal1 faces into it, this works. If not, I think you need to transpose/inverse the relative matrix first

I dont know how to express that using 'proper' matrix notation. Probably something like

relative = camera * inverse(portal1)

renderFrom = portal2*relative

(renderFrom = portal2*inverse(relative) if portal2 is pointing into wall just like portal1)

But Im really not sure.

 

If you are not using matrices, you can use the same logic as in the first piece of code except instead of matrices you do the operations on position/rotation or whatever it is youre using.

 

Also since the camera will be inside the wall when rendering the scene from other portals PoV, you need to make sure nothing behind the portal gets rendered somehow (unless required for reflections or whatever).


In Topic: Edge artifact with basic diffuse shading

02 July 2015 - 12:51 PM

Looks like you have face-culling disabled and the depth-buffer precision isn't enough to avoid Z-fighting at the edges.

Create a 24-bit depth-buffer, or increase the distance to your near-plane in the projection matrix, like changing 0.01 to 0.1 or even 1.

 

Its implicit here, but you should enable face culling if you dont need it to be disabled, as well. At least this particular scene does not need it disabled, assuming the cube meshes are defined correctly (counterclockwise order defined triangle vertices)


In Topic: Is gamesdevil.net an imposter of gamedev.net?

01 July 2015 - 06:47 AM

Ive at least ended up clicking on such clone sites while searching for some topic if I dont quite find what I want in the first search results - Ill then look at the later ones, and some might just be duplicated of the first site except on a sketchy site so Ill just look "link not marked as visited *check* relevant keywords *check*" - If its a clone of some of the first search results, I might have visited a few other ones and maybe got distracted doing something else on the way so I wont necessarily realize its the same thing just looking at the google search result.

 

Maybe the site will catch such people who didnt find what they were looking for and see it as another relevant page.


In Topic: Slerp over a triangle?

01 July 2015 - 12:10 AM

slerp0 = v0.slerp(v2, a0);
slerp1 = v1.slerp(v2, a0);

result = slerp0.slerp(slerp1, a1 / (1.0-a0));

 

a1 / (1.0-a0) will be greater than 1 if a0 > 1.0-a1 I think?


PARTNERS