Welcome aboard Visitor...

Daily Screenshot

Server Costs Target


84% of target met.

Latest Topics

- so i talked with Massi »
- See Commands »
- Now the fun begins »
- Qand answers have returned »
- Call to Arms »
- All Species 8572 Report in »
- hi there »
- Anyone still playing from a decade ago or longer? »
- Game still active. NICE! »
- help me »

Development Blog

- Roadmap »
- Hello strangers, it’s been a while... »
- State of DarkSpace Development »
- Potential planetary interdictor changes! »
- The Silent Cartographer »

Combat Kills

Combat kills in last 24 hours:
Kills chart
UGTO (1) ICC (0) K'Luth (0)

Upcoming Events

- Weekly DarkSpace
11/23/24 +2.1 Days

Search

Anniversaries

No anniversaries today.

Social Media

Why not join us on Discord for a chat, or follow us on Twitter or Facebook for more information and fan updates?

Network

DarkSpace
DarkSpace - Beta
Palestar

[FAQ
Forum Index » » Developer Announcements » » Fulstrum Bug...
 Author Fulstrum Bug...
Faustus
Marshal
Palestar


Joined: May 29, 2001
Posts: 2748
From: Austin, Texas
Posted: 2003-07-29 11:19   
I just finished adding code to check if a zone's hull is visible, which increase the rendering speed ALOT... but I've got some bug in my boxVisible() routine. I suspect the problem is actually how I create my viewing fulstrums for clip testing. I'm working on the problem, but if any of you happen to know alot about planes and viewing fulstrums take a look at the following code to see if you spot my problem...

I suspect setting the distance to 0 for the right, left, top, and bottom planes is not right.

void RenderContext::setProjection( const RectInt & window,
float fov, float front, float back )
{
ASSERT( m_Display.valid() );

if ( window.valid() )
m_Window = window;
else
m_Window = m_Display->renderWindow();

m_Fov = fov;
m_Front = front;
m_Back = back;

// perspective projection
m_Fulstrum[FRONT].set(Vector3(0,0,1),m_Front);
m_Fulstrum[BACK].set(Vector3(0,0,-1),m_Back);

float cosine = cos(m_Fov);
float icosine = 1.0 - cosine;

m_Fulstrum[RIGHT].set(Vector3(-cosine, 0, icosine),0.0f);
m_Fulstrum[LEFT].set(Vector3(cosine, 0, icosine),0.0f);
m_Fulstrum[TOP].set(Vector3(0, -cosine, icosine),0.0f);
m_Fulstrum[BOTTOM].set(Vector3(0, cosine, icosine),0.0f);

// used by project and unProject
m_Center = PointFloat( (m_Window.right + m_Window.left) >> 1, (m_Window.top + m_Window.bottom) >> 1 );
m_D = float( m_Window.width() >> 1 ) / tan( m_Fov * 0.5f );
m_W = 1.0f / (m_Back - m_Front);

// set the projection
PrimitiveSetProjection::createGlobalPush( m_Display, m_Window, m_Fov, m_Front, m_Back );
}


_________________
Richard -Faustus- Lyle
Lead Programmer - DarkSpace
www.darkspace.net / www.palestar.com



[ This Message was edited by: Faustus on 2003-07-29 11:20 ]
_________________


  Goto the website of Faustus
Faustus
Marshal
Palestar


Joined: May 29, 2001
Posts: 2748
From: Austin, Texas
Posted: 2003-07-29 12:36   
Ok, nevermind it's now fixed.
_________________


  Goto the website of Faustus
Page created in 0.007957 seconds.


Copyright © 2000 - 2024 Palestar Inc. All rights reserved worldwide.
Terms of use - DarkSpace is a Registered Trademark of PALESTAR