Welcome aboard Visitor...

Daily Screenshot

Server Costs Target


9% of target met.

Latest Topics

- Anyone still playing from a decade ago or longer? »
- Game still active. NICE! »
- Password resett »
- Darkspace Idea/Opinion Submission Thread »
- Rank Bug maybe? »
- Next patch .... »
- Nobody will remember me...but. »
- 22 years...asking for help from one community to another »
- DS on Ubuntu? »
- Medal Breakpoints »

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:
No kills today... yet.

Upcoming Events

- Weekly DarkSpace
05/04/24 +1.9 Days

Search

Anniversaries

20th - Relient
19th - Entil-Zha the Starkiller

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.006938 seconds.


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