CaduneTree

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CaduneTree

Post by jacmoe »

haffax wrote:
jacmoe wrote:Not really. CaduneTree is MIT. :wink:
Doesn't matter, because a lib released under MIT can always be rereleased under GPL, it conforms with MIT license.
But actually this doesn't matter here, because lugre wiki and source say MIT license.

So is Lugre MIT or GPL, SiENcE?
I know that a MIT project can be included in a GPL project just fine.
Just meant that it's not really appealing to me to use a project under the GPL when I can use it under the MIT.
IMHO, GPL fits applications fine, but is an awful license for libraries.
Except in those cases where the license owner is offering commercial licenses..

I know that IRIS is GPL'ed, but didn't know Lugre was. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
SiENcE
Goblin
Posts: 231
Joined: Thu May 11, 2006 3:07 pm
Location: Berlin
Contact:

Re: CaduneTree

Post by SiENcE »

Oh sorry. We decided Lugre to be MIT. But integration MIT projects into GPL projects should be fine.

I forgot that due to so many projects ;-).
epha
Halfling
Posts: 51
Joined: Tue Dec 11, 2007 11:34 pm

Re: CaduneTree

Post by epha »

Hi, thanks for the responses to my post.

I decided to approach the problem of getting trees moving in the wind with a different tree generation method. Since this is a CaduneTree thread, I posted here http://www.ogre3d.org/forums/viewtopic.php?f=8&t=52339 with what I've done so far.

epha
User avatar
SiENcE
Goblin
Posts: 231
Joined: Thu May 11, 2006 3:07 pm
Location: Berlin
Contact:

Re: CaduneTree

Post by SiENcE »

Hey,

nice approach. I updated our Lugre Sample code. The CaduneTree-Leaves are moving in the Wind now, with a simple shader. I also activated Caelum, now it looks pretty nice :-).

ImageImageImageImage

it's simple to script Ogre with the usage of Lugre (lua). here is the sample code:

Code: Select all

--- main function, when it returns, the program ends
function Main ()
	local luaversion = string.sub(_VERSION, 5, 7)
	print("Lua version : "..luaversion)

	HandleCommandLine()
	
	gMyTicks = Client_GetTicks()
	
	if (not InitOgre("LugreExample",lugre_detect_ogre_plugin_path())) then Exit() end
	if (OgreInitResLocs) then OgreInitResLocs() end
	
	Client_RenderOneFrame() -- first frame rendered with ogre, needed for init of viewport size
	
	----- your init code here ----
	Bind("v",   function (state) Client_TakeScreenshot(gMainWorkingDir.."screenshots/") end )

	------------------------------
	-- CaduneTree	
	local p = CreateCaduneTreeParameters()
	p:SetNumLeaves(5)
	p:SetLeafScale(3)
	print( p:GetLeafMaterial() )
	
	p:SetLeafMaterial("Leaves/Orange")
	--p:SetLeafMaterial("Leaves/Ivylite")
	
	local s = CreateCaduneTreeStem(p)
	s:Grow()
	local gfx_stem = s:CreateGeometry()
	local gfx_leav = s:CreateLeaves()

	gfx_stem:SetPosition(0,-6,23)
	gfx_leav:SetPosition(0,-6,23)

	------------------------------
	-- Caelum
	gCaelumSystem = CreateCaelumCaelumSystem(
		CAELUM_COMPONENT_SUN + 
		CAELUM_COMPONENT_MOON +
        CAELUM_COMPONENT_SKY_DOME +
        CAELUM_COMPONENT_IMAGE_STARFIELD +
        CAELUM_COMPONENT_CLOUDS +
        CAELUM_COMPONENT_PRECIPITATION +
        0	--CAELUM_COMPONENT_GROUND_FOG
	)
			
	gCaelumSystem:SetManageSceneFog(true)
	gCaelumSystem:SetSceneFogDensityMultiplier(0.0015)
	gCaelumSystem:SetManageAmbientLight(true)
		
    -- Sunrise with visible moon.
    local cl = gCaelumSystem:GetUniversalClock()
    cl:SetGregorianDateTime(2007, 4, 9, 9, 33, 10)
    cl:SetTimeScale(2500)

	-- mainloop
	while (Client_IsAlive()) do MainStep() end

	----- your deinit code here ----
	
	--Cleanup
	if (gfx) then gfx:Destroy() end
	if (s) then s:Destroy() end
	if (p) then p:Destroy() end
	------------------------------
end

-- called every frame, after all timer-steppers, see Step() in lib.time.lua
function MainStep ()
	if (gMainWindowSizeDirty) then UpdateMainWindowSize() end
	
	LugreStep()
	
	NetReadAndWrite()
	
	InputStep() -- generate mouse_left_drag_* and mouse_left_click_single events 
	GUIStep() -- generate mouse_enter, mouse_leave events (might adjust cursor -> before CursorStep)
	ToolTipStep() -- needs mouse_enter, should be after GUIStep
	
	CursorStep() -- update cursor gfx pos, should be directly before frame is drawn
	Client_RenderOneFrame()

	-- kill the programm with the escape key
	if gKeyPressed[GetNamedKey("escape")] then Terminate() end

	--SoundStep()
	Client_USleep(1) -- just 1 millisecond, but gives other processes a chance to do something
end
Anyone can find the Lugre Sample and the scriptcode here.
SiENcE
User avatar
nevarim
Gnoll
Posts: 675
Joined: Mon Jul 05, 2010 6:16 pm
Location: Pavia Italy
x 4
Contact:

Re: CaduneTree

Post by nevarim »

congratulations for plugin :D very nice
i'm a noob until proven otherwise :D
used in my project ;) and thanks to everyone :D
Ogre 3d
Mygui
Skyx
Hydrax
MOC
CCS
Sgw32
Greenskin
Posts: 100
Joined: Mon Aug 30, 2010 9:35 am
x 11

Re: CaduneTree

Post by Sgw32 »

Thanks for this plugin - it's just wonderful!
Just a question - how many poly-s does your tree engine take and does it have any LODs? It's much appreciated! :D
EDIT:
Ifound your triangle count and it's great!
But I have a problem, when I just load the CTStudio Editor, and then press "Save" and save to mtd file, nothing happens - file doesn't saves :( What's wrong?
Post Reply