Author Topic: Question: Models, lighting, and more.  (Read 8424 times)

Offline Raven

  • int
  • **
  • Posts: 62
    • View Profile
    • http://www.vortex.is/raven
Question: Models, lighting, and more.
« Reply #15 on: November 06, 2005, 10:28:24 pm »
Quote from: "EgonOlsen"
No, you have to do this yourself. It's easy. Just iterate through the objects of a world, get their transformed center and calculate the distance from the camera's position (i.e. subtract the camera's position and get the length...can both be done by using the appropriate methods in SimpleVector) to each of them.


Ach.. ofcourse. Thanks for answering a stupid question. I thought it the other way around all the time. I implemented this and it worked perfectly. :)

Quote from: "raft"

possibly not best way, but i find this very handy:
i either:
* place dummy objects to mark those positions and save them in a seperate file (like lights.3ds) and then use the center of those objects to place lights
* again place dummy objects but save thier positions with max script (faster loading time and less space)


Hey raft. Thanks for the feedback.
I'm just about to start trying out these methods, so your timing is perfect, however -- I'm unsure of exactly what you mean?

*For your first point: I think you're talking about the same thing that Helge had already already pointed out to me, except that you want me to put it in a seperate file? But wouldn't I then have to align my map.3ds with the lights.3ds after I import them into jPCT?

*Second point: Actually, I'm not using 3D Studio, I'm using Blender (free, open source) -- problem is I have to export the Blender files to as .obj, then import them into another program which can export as .3ds.

There is a scripting system in Blender, maybe I can utilize that. Sounds good.

But discussing Blender actually brings me to another issue I've been dealing with.

I haven't been able to load textures properly in jPCT when using a .3ds file. Has anyone been using blender for models? I'm wondering if my importing and exporting ruins the texture coordinates on objects somehow.

jPCT loads the correct materials successfully, like "steelfloor" (which in Blender links to the steelfloor.jpg). But for some reason adding steelfloor.jpg and naming it "steelfloor" in jPCT produces no results.

Q1: Aren't the 3ds models supposed to find the textures themselves if they are imported into TextureManager?
Q2: It's the name of the material that 3ds models use for texturing that matters, not the .jpg name, right?


Thanks for all your help!
- Hrafn "Raven" Thorisson

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Question: Models, lighting, and more.
« Reply #16 on: November 07, 2005, 07:21:18 am »
Quote from: "Raven"

Q1: Aren't the 3ds models supposed to find the textures themselves if they are imported into TextureManager?
Q2: It's the name of the material that 3ds models use for texturing that matters, not the .jpg name, right?
IF they are named correctly, then yes, jPCT will find and use them. If they are not named correctly, you should see this on the console. jPCT will tell you that it has added a texture named "blahblah" to the TextureManager. That's the name you have to give it when adding it before loading the model.

Offline raft

  • quad
  • ******
  • Posts: 1972
    • View Profile
    • http://www.aptalkarga.com
Question: Models, lighting, and more.
« Reply #17 on: November 07, 2005, 09:14:02 am »
Quote from: "Raven"
I think you're talking about the same thing that Helge had already already pointed out to me, except that you want me to put it in a seperate file? But wouldn't I then have to align my map.3ds with the lights.3ds after I import them into jPCT?

not exactly, i think we were talking about different things.
i couldnt get what you meant by aligning ? those dummy 'light' objects are already positioned in your world. just export the world to map.3ds and lights to lights.3ds
Code: [Select]
r a f t

Offline Raven

  • int
  • **
  • Posts: 62
    • View Profile
    • http://www.vortex.is/raven
Question: Models, lighting, and more.
« Reply #18 on: November 09, 2005, 06:40:52 pm »
Ah, I see what you mean now, Raft.
For some reason I imagined that the coordinates of the objects would get distorted if saved into a different file than the actual map -- but of course not. That's why I talked about re-aligning the objects with the level.

Yeah, seperating the objects into different 3DS files would simplify things, or rather, make the code easier to handle.

Thanks!

-Hrafn "Raven"