Crystal Space
Welcome, Guest. Please login or register.
September 03, 2014, 08:36:37 am

Login with username, password and session length
Search:     Advanced search
9009 Posts in 2043 Topics by 8381 Members
Latest Member: Juanafrench
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Get position of camera in simple2 application
« previous next »
Pages: [1] Print
Author Topic: Get position of camera in simple2 application  (Read 4122 times)
ivanguy
Newbie
*
Posts: 10


View Profile Email
« on: October 23, 2005, 01:16:09 am »

Hello,

I customize simple2 app now.
How can i get camera coordinates in ProcessFrame() procedure?

This will need for iLight->SetCenter proc.

Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: October 23, 2005, 09:27:11 am »

Hello,

I customize simple2 app now.
How can i get camera coordinates in ProcessFrame() procedure?

This will need for iLight->SetCenter proc.



view->GetCamera ()->GetTransform ().GetOrigin()

Greetings,
Logged
ivanguy
Newbie
*
Posts: 10


View Profile Email
« Reply #2 on: October 24, 2005, 05:02:59 am »

Ok, thanks.
I add this code, seems it works, but the dynamic light dont move!

----In this code i create the light:

  light = engine->CreateLight("farcamera", csVector3(-1, 5, 30), 10, csColor(1, 1, 1),CS_LIGHT_DYNAMICTYPE_DYNAMIC);
  ll->Add (light);

----This code try to move the light:

  iLight* mylight=engine->FindLight("farcamera");
  mylight->SetCenter( view->GetCamera ()->GetTransform ().GetOrigin());
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: October 24, 2005, 05:23:31 am »

After moving the light you must call light->Setup(). Due to a bug in CS you even must call it twice.

Greetings,
Logged
ivanguy
Newbie
*
Posts: 10


View Profile Email
« Reply #4 on: October 25, 2005, 01:48:21 am »


Yes, it works, thank you.

I develop the metro sim (for fun). http://redsky-studio.com/BLOG/
There is one big tunnel. This is good idea to make the tunnel from sectors.
But where i can take examples for sector creation? (I do map from program code)
Logged
deckerego
Full Member
***
Posts: 149


View Profile WWW
« Reply #5 on: October 25, 2005, 03:47:30 am »

You might want to take a look at walktest - there's an option that will create an endless maze based on sectors. Sounds right up your alley.
Logged
ivanguy
Newbie
*
Posts: 10


View Profile Email
« Reply #6 on: October 28, 2005, 02:41:56 am »

Ok, i can create the portals and sectors now, thanks.

I create big tunnel (0-20000 Z) from sectors (length is 70 Z).

It is VERY SLOW. What should i do?
Logged
deckerego
Full Member
***
Posts: 149


View Profile WWW
« Reply #7 on: October 28, 2005, 03:04:46 am »

You might want to use visability culling, clipping a far plane or implementing fog if things are getting too long. If you're using hardware rendering on just a tunnel, tho, you should be largely okay.
Logged
ivanguy
Newbie
*
Posts: 10


View Profile Email
« Reply #8 on: October 29, 2005, 12:37:04 am »

Where can i find this samples or docs?
Logged
ivanguy
Newbie
*
Posts: 10


View Profile Email
« Reply #9 on: October 29, 2005, 01:03:45 am »

Ok, i find this :

iCamera->SetFarPlane from walkcmd.cpp
    csPlane3 farplane(0,0,-1,distance);
    Sys->view->GetCamera()->SetFarPlane(&farplane);

.

Logged
ivanguy
Newbie
*
Posts: 10


View Profile Email
« Reply #10 on: October 31, 2005, 02:49:34 am »

Please tell me, where i can find samples for create:
- bump-mapping textures
- textures with shader

- Is CS support directional lights?
- Where the easy way to create models?

Thank you for your answers.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.223 seconds with 16 queries.