[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

3D Engine and problems

Posted on 2002-04-20
2
Medium Priority
?
216 Views
Last Modified: 2013-12-26
Hey, im making a dx8 engine, if you want to see the first version, visit http://www.y3knetwork.com and goto rendertech. Im having a slight problem though. Im trying to make lights, and I cant set the attenuation range. can someone explain?
Thanks
0
Comment
Question by:alkakios
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
joachimc earned 75 total points
ID: 6979661
Hmm the attenuation is set on spotlights

In the D3DLIGHT8 you have
D3DLIGHT8 myLight;
D3DCOLORVALUE myColor;
D3DVECTOR myPosition;
D3DVECTOR myPointAt;

//Set position of light
myPosition.x = 10;
myPosition.y = 10;
myPosition.z = 10;

//Set direction of light
myPointAt.x = 0;
myPointAt.y = 0;
myPointAt.z = 0;

myColor.r = 1;
myColor.g = 1;
myColor.b = 1;
myColor.a = 1; //Alpha

//Linear attenuation
myLight.Attenuation0 = MyLightAttenuation;
//squared attenuation
myLight.Attenuation1 = MyLightAttenuation;
//exponential attenuation
myLight.Attenuation2 = MyLightAttenuation;
myLight.Diffuse =

Then you have to create a spotlight
myLight.Type = D3DLIGHT_SPOT;
myLight.Position = myPosition;
myLight.Direction = myPointAt;
myLight.Diffuse = myColor;
myLight.Specular = myColor;

//Turn on light
myD3DDevice->SetLight(0, &myLight);
myD3DDevice->LightEnable(0, TRUE);
myD3DDevice->SetRenderState( D3DRS_LIGHTING, TRUE );

Experiment with the Attenuation to get it right.
That's about it
/Joachim

0
 
LVL 4

Expert Comment

by:joachimc
ID: 7036509
so

What's happening here ???

/Joachim
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question